ProjectionModule

PackageFCQRS
Constructors for the projection-handler shapes.

Summary

NameSignatureSynopsis
multimulti progress handleMulti-event handler with full control.
singlesingle progress handleSingle-event handler: just update the read model (returns unit); each aggregate event is then published to subscribers as-is.
filteredfiltered progress handleFiltered single-event handler: update the read model, then return Publish/Suppress to decide whether *this* event wakes subscribers.
ofEntitiesofEntities names pReads only the events of the named entities: an aggregate's, saga's, or workflow's name, as registered.

multi

multi progress handle
Member
Multi-event handler with full control. Return exactly the notifications to publish (empty list = nothing). Use when notifications must be filtered or transformed, e.g. suppressing intermediate events so read-your-writes only wakes on the final one.

Parameters

NameTypeDescription
progressProjectionProgress
handleobj -> IMessageWithCID list

Returns

Projection

single

single progress handle
Member
Single-event handler: just update the read model (returns unit); each aggregate event is then published to subscribers as-is. The common case when every event is worth notifying.

Parameters

NameTypeDescription
progressProjectionProgress
handleobj -> unit

Returns

Projection

filtered

filtered progress handle
Member
Filtered single-event handler: update the read model, then return Publish/Suppress to decide whether *this* event wakes subscribers. The middle rung between `single` (always publish) and `multi` (return an arbitrary notification list). Use it for the common "publish each event except the intermediate ones" case, without building a list.

Parameters

NameTypeDescription
progressProjectionProgress
handleobj -> Notify

Returns

Projection

ofEntities

ofEntities names p
Member
Reads only the events of the named entities: an aggregate's, saga's, or workflow's name, as registered. A name selects the persistence IDs that start with it, escaped as Akka escapes a sharding region's name (Uri.EscapeDataString), and "/". The journal queries select those rows in SQL, so other entities' events are not fetched or deserialized. On SQLite and SQL Server the full scan reads only the names' range of the journal's persistence-ID index, and the queries bounded by a journal number read every row above it; PostgreSQL reads other entities' rows in every query. A pass reads each persistence ID's events with a query of its own. A pass hands the named entities' events to the handler in journal order, as without a filter. An empty list reads every entity.

Parameters

NameTypeDescription
namesstring list
pProjection

Returns

Projection