Search Results for

    Show / Hide Table of Contents

    Class InMemoryReadJournal

    Inheritance
    object
    InMemoryReadJournal
    Implements
    IPersistenceIdsQuery
    ICurrentPersistenceIdsQuery
    ICurrentEventsByPersistenceIdQuery
    IEventsByPersistenceIdQuery
    ICurrentEventsByTagQuery
    IEventsByTagQuery
    ICurrentAllEventsQuery
    IAllEventsQuery
    IReadJournal
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Persistence.Query.InMemory
    Assembly: Akka.Persistence.Query.InMemory.dll
    Syntax
    public class InMemoryReadJournal : IPersistenceIdsQuery, ICurrentPersistenceIdsQuery, ICurrentEventsByPersistenceIdQuery, IEventsByPersistenceIdQuery, ICurrentEventsByTagQuery, IEventsByTagQuery, ICurrentAllEventsQuery, IAllEventsQuery, IReadJournal

    Constructors

    | Edit this page View Source

    InMemoryReadJournal(Config)

    Declaration
    public InMemoryReadJournal(Config config)
    Parameters
    Type Name Description
    Config config

    Fields

    | Edit this page View Source

    Identifier

    Declaration
    public const string Identifier = "akka.persistence.query.journal.inmem"
    Field Value
    Type Description
    string

    Methods

    | Edit this page View Source

    AllEvents(Offset)

    Declaration
    public Source<EventEnvelope, NotUsed> AllEvents(Offset offset = null)
    Parameters
    Type Name Description
    Offset offset
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    CurrentAllEvents(Offset)

    Declaration
    public Source<EventEnvelope, NotUsed> CurrentAllEvents(Offset offset)
    Parameters
    Type Name Description
    Offset offset
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    CurrentEventsByPersistenceId(string, long, long)

    Same type of query as EventsByPersistenceId(string, long, long) but the event stream is completed immediately when it reaches the end of the "result set". Events that are stored after the query is completed are not included in the event stream.

    Declaration
    public Source<EventEnvelope, NotUsed> CurrentEventsByPersistenceId(string persistenceId, long fromSequenceNr, long toSequenceNr)
    Parameters
    Type Name Description
    string persistenceId
    long fromSequenceNr
    long toSequenceNr
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    CurrentEventsByTag(string, Offset)

    Same type of query as EventsByTag(string, Offset) but the event stream is completed immediately when it reaches the end of the "result set". Events that are stored after the query is completed are not included in the event stream.

    Declaration
    public Source<EventEnvelope, NotUsed> CurrentEventsByTag(string tag, Offset offset)
    Parameters
    Type Name Description
    string tag
    Offset offset
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    CurrentPersistenceIds()

    Same type of query as PersistenceIds() but the stream is completed immediately when it reaches the end of the "result set". Persistent actors that are created after the query is completed are not included in the stream.

    Declaration
    public Source<string, NotUsed> CurrentPersistenceIds()
    Returns
    Type Description
    Source<string, NotUsed>
    | Edit this page View Source

    DefaultConfiguration()

    Declaration
    public static Config DefaultConfiguration()
    Returns
    Type Description
    Config
    | Edit this page View Source

    EventsByPersistenceId(string, long, long)

    EventsByPersistenceId(string, long, long) is used for retrieving events for a specific PersistentActor identified by PersistenceId.

    You can retrieve a subset of all events by specifying fromSequenceNr and toSequenceNr or use `0L` and MaxValue respectively to retrieve all events. Note that the corresponding sequence number of each event is provided in the EventEnvelope, which makes it possible to resume the stream at a later point from a given sequence number.

    The returned event stream is ordered by sequence number, i.e. the same order as the PersistentActor persisted the events. The same prefix of stream elements (in same order) are returned for multiple executions of the query, except for when events have been deleted.

    The stream is not completed when it reaches the end of the currently stored events, but it continues to push new events when new events are persisted. Corresponding query that is completed when it reaches the end of the currently stored events is provided by CurrentEventsByPersistenceId(string, long, long).

    The InMemory write journal is notifying the query side as soon as events are persisted, but for efficiency reasons the query side retrieves the events in batches that sometimes can be delayed up to the configured `refresh-interval`.

    The stream is completed with failure if there is a failure in executing the query in the backend journal.
    Declaration
    public Source<EventEnvelope, NotUsed> EventsByPersistenceId(string persistenceId, long fromSequenceNr, long toSequenceNr)
    Parameters
    Type Name Description
    string persistenceId
    long fromSequenceNr
    long toSequenceNr
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    EventsByTag(string, Offset)

    EventsByTag(string, Offset) is used for retrieving events that were marked with a given tag, e.g. all events of an Aggregate Root type.

    To tag events you create an IEventAdapter that wraps the events in a Tagged with the given `tags`.

    You can use NoOffset to retrieve all events with a given tag or retrieve a subset of all events by specifying a Sequence. The `offset` corresponds to an ordered sequence number for the specific tag. Note that the corresponding offset of each event is provided in the EventEnvelope, which makes it possible to resume the stream at a later point from a given offset.

    The `offset` is exclusive, i.e. the event with the exact same sequence number will not be included in the returned stream.This means that you can use the offset that is returned in EventEnvelope as the `offset` parameter in a subsequent query.

    In addition to the offset the EventEnvelope also provides `persistenceId` and `sequenceNr` for each event. The `sequenceNr` is the sequence number for the persistent actor with the `persistenceId` that persisted the event. The `persistenceId` + `sequenceNr` is an unique identifier for the event.

    The returned event stream is ordered by the offset (tag sequence number), which corresponds to the same order as the write journal stored the events. The same stream elements (in same order) are returned for multiple executions of the query. Deleted events are not deleted from the tagged event stream.

    The stream is not completed when it reaches the end of the currently stored events, but it continues to push new events when new events are persisted. Corresponding query that is completed when it reaches the end of the currently stored events is provided by CurrentEventsByTag(string, Offset).

    The InMemory write journal is notifying the query side as soon as tagged events are persisted, but for efficiency reasons the query side retrieves the events in batches that sometimes can be delayed up to the configured `refresh-interval`.

    The stream is completed with failure if there is a failure in executing the query in the backend journal.
    Declaration
    public Source<EventEnvelope, NotUsed> EventsByTag(string tag, Offset offset)
    Parameters
    Type Name Description
    string tag
    Offset offset
    Returns
    Type Description
    Source<EventEnvelope, NotUsed>
    | Edit this page View Source

    PersistenceIds()

    PersistenceIds() is used for retrieving all `persistenceIds` of all persistent actors.

    The returned event stream is unordered and you can expect different order for multiple executions of the query.

    The stream is not completed when it reaches the end of the currently used `persistenceIds`, but it continues to push new `persistenceIds` when new persistent actors are created. Corresponding query that is completed when it reaches the end of the currently currently used `persistenceIds` is provided by CurrentPersistenceIds().

    The inmemory write journal is notifying the query side as soon as new `persistenceIds` are created and there is no periodic polling or batching involved in this query.

    The stream is completed with failure if there is a failure in executing the query in the backend journal.

    Declaration
    public Source<string, NotUsed> PersistenceIds()
    Returns
    Type Description
    Source<string, NotUsed>

    Implements

    IPersistenceIdsQuery
    ICurrentPersistenceIdsQuery
    ICurrentEventsByPersistenceIdQuery
    IEventsByPersistenceIdQuery
    ICurrentEventsByTagQuery
    IEventsByTagQuery
    ICurrentAllEventsQuery
    IAllEventsQuery
    IReadJournal

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET