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

The Bitfinex trades websocket sends lists in different formats. This module aims to dispatch them through pattern matching and send messages to the PubSub if necessary.

Link to this section Summary

Functions

Dispatches trade frames received by the Bitfinex websocket

Link to this section Functions

Link to this function

manage_frame(frame, opts \\ [])

View Source
@spec manage_frame(list(), list()) :: atom() | {:ok, map()}

Dispatches trade frames received by the Bitfinex websocket

examples

Examples

iex> pub_sub_name = :manage_frame_doctest
...> BitfinexClient.PubSub.start_link(pub_sub_name: pub_sub_name)
...> BitfinexClient.PubSub.subscribe(:btc_usd_ticker, pub_sub_name: pub_sub_name)
...> [473431, "te", "1227389557-tBTCUSD", 1665749864, 19630, -0.00204594]
...> |> BitfinexClient.Websocket.Trades.Handler.manage_frame(pub_sub_name: pub_sub_name)
...> receive do
...>   frame -> frame
...> end
19630