Tradehub.Stream.recent_trades

You're seeing just the function recent_trades, go back to Tradehub.Stream module for more information.

Specs

recent_trades(String.t()) :: :ok | {:error, reason :: any()}

Subscribes to the recent_trades.[market] channel to request the recent trades of the given market.

A topic named recent_trades.[market] in the Tradehub.PubSub will automatically created to handle incomming messages of this subscription.

Examples

iex> alias Phoenix.PubSub
iex> PubSub.subscribe Tradehub.PubSub, "recent_trades.swth_eth1"
iex> Tradehub.Stream.recent_trades("swth_eth1")
iex> Process.info(self(), :messages)
iex> Tradehub.Stream.unsubscribe "recent_trades.swth_eth1"