symphony.bdk.core.service.datafeed.abstract_datahose_loop.AbstractDatahoseLoop#
- class symphony.bdk.core.service.datafeed.abstract_datahose_loop.AbstractDatahoseLoop#
Bases:
abc.ABC
Base class for implementing the datahose services.
A datahose service can help a bot to get all the received real-time events that are set as filters in the configuration.
- __init__()#
Methods
__init__
()start
()Start the datahose event service
stop
([hard_kill, timeout])Stop the datahose event service
subscribe
(listener)Subscribes a new listener to the datahose loop instance.
unsubscribe
(listener)Removes a given listener from the datahose loop instance.
- abstract async start()#
Start the datahose event service
- Returns
None
- abstract async stop(hard_kill: bool = False, timeout: Optional[float] = None)#
Stop the datahose event service
- Parameters
hard_kill – if set to True, tasks running listener methods will be cancelled immediately. Otherwise, tasks will be awaited until completion.
timeout – timeout in seconds to wait for tasks completion when loop stops. None means wait until completion. Ignored if hard_kill set to True.
- Returns
None
- abstract subscribe(listener: symphony.bdk.core.service.datafeed.real_time_event_listener.RealTimeEventListener)#
Subscribes a new listener to the datahose loop instance.
- Parameters
listener – the RealTimeEventListener to be added.
- abstract unsubscribe(listener: symphony.bdk.core.service.datafeed.real_time_event_listener.RealTimeEventListener)#
Removes a given listener from the datahose loop instance.
- Parameters
listener – the RealTimeEventListener to be removed.