Tradehub.Stream.books

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

Specs

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

Subscribes to the books.[market] channel to request the latest orderbook of the given market.

A topic named books.[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, "books.swth_eth1"
iex> Tradehub.Stream.books("swth_eth1")
iex> Process.info(self(), :messages)
iex> Tradehub.Stream.unsubscribe "books.swth_eth1"