houndcore.app package

Subpackages

Submodules

houndcore.app.dispatcher module

class houndcore.app.dispatcher.Dispatcher[source]

Bases: object

the event manager (dispatcher)

async handle_event(context: EthSubscriptionContext[LogsSubscription, EthSubscriptionResult] | EthSubscriptionContext[PendingTxSubscription, HexBytes | TxData]) None[source]

handles any new events

Parameters:

context (Union[web3.utils.PendingTxSubscriptionContext, web3.utils.LogsSubscriptionContext]) – the event context

poll(sub_id: str, limit: int) List[EthSubscriptionContext[LogsSubscription, EthSubscriptionResult] | EthSubscriptionContext[PendingTxSubscription, HexBytes | TxData]] | None[source]

poll any new events using the subscription id

Parameters:
  • sub_id (str) – the subscription id

  • limit (int) – the limit of returned results

Returns:

Union[List[Context], None]

subscribe(sub_id: str) None[source]

Subscribe to a subscription using its id

Parameters:

sub_id (str) – the subscription id

unsubscribe(sub_id: str) None[source]

Un-Subscribe to a subscription using its id

Parameters:

sub_id (str) – the subscription id

Module contents