Skip to content

Entry

Container for a single event and its stream identifier.

Used as a base DTO for representing an event (with all metadata) and the stream it belongs to. Serves as a base for more specialized event store DTOs (e.g. Recorded).

Attributes:

Name Type Description
wrapped_event WrappedEvent[Event]

The event instance with metadata.

stream_id StreamId

The identifier of the stream to which the event belongs.

Source code in event_sourcery/_event_store/event/dto.py
@dataclasses.dataclass(frozen=True)
class Entry:
    """
    Container for a single event and its stream identifier.

    Used as a base DTO for representing an event (with all metadata) and the stream
    it belongs to. Serves as a base for more specialized event store DTOs (e.g. Recorded).

    Attributes:
        wrapped_event (WrappedEvent[Event]): The event instance with metadata.
        stream_id (StreamId): The identifier of the stream to which the event belongs.
    """

    wrapped_event: WrappedEvent[Event]
    stream_id: StreamId