EventEnvelope
An event together with the metadata an EventStore records about it.
Envelopes are what an EventStore returns from readFrom and readAll, and what it publishes on its subscribe hub when a new event is appended. The ProjectionEngine reads them to run a projection's handlers: it passes event to the handler, along with a ProjectionContext built from entityId, timestamp and seq.
The type is covariant in E, so an EventEnvelope[UserCreated] can be used where an EventEnvelope[Any] is expected.
Type parameters
- E
-
the event type
Value parameters
- entityId
-
the entity the event was recorded under, which a handler sees as
ctx.entityId - event
-
the event itself
- seq
-
the position of the event in its store, increasing with each append. The engine saves the last
seqit processed and resumes after it on restart - tag
-
the name that identifies the kind of event. The SQLite store uses the case name or the number from
@eventTag, and replaces an old tag with its current one when tag aliases are configured. The in-memory test store uses the event class's simple name - timestamp
-
when the event was recorded
Attributes
- Source
- EventEnvelope.scala
- Graph
-
- Supertypes