View Source BitfinexClient.PubSub (bitfinex_client v0.1.0)
A way to dispatch messages to multiple recipients, based on topics
Link to this section Summary
Functions
Publishes a message in a specific topic
Starts the PubSub manager
Subscribe the current process to a topic
Link to this section Functions
Publishes a message in a specific topic
examples
Examples
iex> pub_sub_name = :pub_sub_publish_doctest
...> BitfinexClient.PubSub.start_link(pub_sub_name: pub_sub_name)
...> BitfinexClient.PubSub.subscribe(:btc_usd_ticker, pub_sub_name: pub_sub_name)
...> BitfinexClient.PubSub.publish(:btc_usd_ticker, 19565, pub_sub_name: pub_sub_name)
...> receive do
...> price -> price
...> end
19565
Starts the PubSub manager
Subscribe the current process to a topic
examples
Examples
iex> BitfinexClient.PubSub.start_link()
...> BitfinexClient.PubSub.subscribe(:btc_usd_ticker)
...> |> elem(0)
:ok