protocols.eventsub.EventSubscriberProtocol
A protocol for consuming events from an event broker.
Usage
protocols.eventsub.EventSubscriberProtocol()In addition to the methods described below, implementations shall expose the the following attributes: topics_of_interest (list[str]): A list of topics of interest to which the provider shall subscribe. types_of_interest (list[str]): A list of event types of interest. Out of the events arriving in the topics of interest, the provider shall only pass events of these types down to the protocol. Events of other types shall be filtered out.
Classes
| Name | Description |
|---|---|
| MalformedPayloadError | Raised if the payload of a received event was not formatted as expected given |
MalformedPayloadError
Raised if the payload of a received event was not formatted as expected given
Usage
MalformedPayloadError()the type.
Methods
| Name | Description |
|---|---|
| consume() | Receive an event of interest and process it according to its type. |
consume()
Receive an event of interest and process it according to its type.
Usage
consume(*, payload, type_, topic, key, event_id)Parameters
payload: JsonObject-
The data/payload to send with the event.
type_: Ascii-
The type of the event.
topic: Ascii-
Name of the topic the event was published to.
key: Ascii-
A key used for routing the event.
event_id: UUID4- The unique identifier of the event.