View Source BitfinexClient.Websocket.Trades (bitfinex_client v0.1.0)

Handling the Bitfinex trades websocket endpoint

https://docs.bitfinex.com/reference/ws-public-trades

Link to this section Summary

Functions

Connection handling, part of the WebSockex spec

When data is being received by Bitfinex, it is being dispatched to BitfinexClient.Websocket.Trades.Handler, or being logged to the console if of an unknown format

Starts a PubSub process linked to the current process

Subscribe to a topic, will send messages to the pid

Called by Websockex when its process gets terminated, most probably by an error

Link to this section Functions

Link to this function

handle_connect(conn, state)

View Source
@spec handle_connect(any(), map()) :: {:ok, map()}

Connection handling, part of the WebSockex spec

Link to this function

handle_frame(frame, state)

View Source
@spec handle_frame(any(), any()) :: {:ok, any()}

When data is being received by Bitfinex, it is being dispatched to BitfinexClient.Websocket.Trades.Handler, or being logged to the console if of an unknown format

@spec start_link(list()) :: {:ok, pid()} | {:error, integer(), binary()}

Starts a PubSub process linked to the current process

examples

Examples

iex> BitfinexClient.Websocket.Trades.start_link()
...> |> elem(0)
:ok
@spec subscribe(pid()) :: :ok

Subscribe to a topic, will send messages to the pid

examples

Examples

iex> BitfinexClient.Websocket.Trades.subscribe(self())
:ok
Link to this function

terminate(reason, state)

View Source

Called by Websockex when its process gets terminated, most probably by an error