Events
EventBus
¶
Event bus used to dispatch events to subscribed callbacks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callbacks |
Iterable[Callable[[Event], Awaitable[None] | None]]
|
Callbacks to subscribe to the event bus. |
None
|
Source code in src/aiosalesforce/events/event_bus.py
subscribe_callback(callback)
¶
Subscribe a callback to the event bus.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callback |
CallbackType
|
Function to be called when an event is published. |
required |
Source code in src/aiosalesforce/events/event_bus.py
unsubscribe_callback(callback)
¶
Unsubscribe a callback from the event bus.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callback |
CallbackType
|
Function to be unsubscribed. |
required |
Source code in src/aiosalesforce/events/event_bus.py
publish_event(event)
async
¶
Publish an event and dispatch it to all subscribed callbacks.
Source code in src/aiosalesforce/events/event_bus.py
Event
dataclass
¶
RequestEvent
dataclass
¶
RetryEvent
dataclass
¶
Bases: Event
, ResponseMixin
Emitted immediately before a request is retried.
Source code in src/aiosalesforce/events/events.py
ResponseEvent
dataclass
¶
Bases: Event
, ResponseMixin
Emitted after an OK (status code < 300) response is received.
Source code in src/aiosalesforce/events/events.py
RestApiCallConsumptionEvent
dataclass
¶
Bases: Event
, ResponseMixin
Emitted after a REST API call is consumed.
Source code in src/aiosalesforce/events/events.py
BulkApiBatchConsumptionEvent
dataclass
¶
Bases: Event
, ResponseMixin
Emitted after a Bulk API batch is consumed.
Source code in src/aiosalesforce/events/events.py
ResponseMixin
¶
Mixin class providing properties for events which may have response.