Skip to content

`stream_signal_buffer`

Oliver Zehentleitner edited this page Feb 14, 2024 · 21 revisions

Activate signals with enable_stream_signal_buffer parameter of BinanceWebSocketApiManager().

Use pop_stream_signal_from_stream_signal_buffer() to pick up signals!

Type Info
CONNECT This signal informs about a successful connection establishment.
DISCONNECT This signal informs about a disconnect and also includes the last received data record. last_received_data_record can contain the last record or None
FIRST_RECEIVED_DATA This signal informs about the first received data record.

Its possible to use a callback function instead of the stream_signal_buffer. Just provide a function to the parameter process_stream_signals within the BinanceWebSocketApiManager() call.

Example function for process_stream_signals:

def processing_of_stream_signals(signal_type=False, stream_id=False, data_record=False):
    print(f"Received stream signal: {signal_type} - {stream_id} - {data_record}")

Example files