protocols.daosub.DaoSubscriberProtocol

A protocol for consuming events published through the DaoPublisherFactoryProtocol.

Usage

Source

protocols.daosub.DaoSubscriberProtocol()

In addition to the methods described below, implementations shall expose the the following attributes: event_topic: The name of the topic from which updates for the given resource are consumed. dto_model: A pydantic model representing the data transfer object (DTO) for the payload of changed events.

If the upstream provider using this protocol fails to convert the payload of a change event to the expected DTO model, it should raise a DtoValidationError.

Methods

Name Description
changed() Consume a change event (created or updated) for the resource with the given
deleted() Consume an event indicating the deletion of the resource with the given ID.

changed()

Consume a change event (created or updated) for the resource with the given

Usage

Source

changed(resource_id, update)

ID.


deleted()

Consume an event indicating the deletion of the resource with the given ID.

Usage

Source

deleted(resource_id)