public Source <EventEnvelope, NotUsed> CurrentAllEvents(Offset offset)
        {
            Sequence seq;

            switch (offset)
            {
            case null:
            case NoOffset _:
                seq = new Sequence(0L);
                break;

            case Sequence s:
                seq = s;
                break;

            default:
                throw new ArgumentException($"SqlReadJournal does not support {offset.GetType().Name} offsets");
            }

            return(Source.ActorPublisher <EventEnvelope>(AllEventsPublisher.Props(seq.Value, null, _maxBufferSize, _writeJournalPluginId))
                   .MapMaterializedValue(_ => NotUsed.Instance)
                   .Named("CurrentAllEvents"));
        }
Exemple #2
0
 /// <summary>
 /// Same type of query as <see cref="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.
 /// </summary>
 public Source <string, NotUsed> CurrentPersistenceIds() =>
 Source.ActorPublisher <string>(AllPersistenceIdsPublisher.Props(false, _writeJournalPluginId))
 .MapMaterializedValue(_ => NotUsed.Instance)
 .Named("CurrentPersistenceIds") as Source <string, NotUsed>;
Exemple #3
0
 /// <summary>
 /// Same type of query as <see cref="EventsByPersistenceId"/> 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.
 /// </summary>
 public Source <EventEnvelope, NotUsed> CurrentEventsByPersistenceId(string persistenceId, long fromSequenceNr, long toSequenceNr) =>
 Source.ActorPublisher <EventEnvelope>(EventsByPersistenceIdPublisher.Props(persistenceId, fromSequenceNr, toSequenceNr, null, _maxBufferSize, _writeJournalPluginId))
 .MapMaterializedValue(_ => NotUsed.Instance)
 .Named("CurrentEventsByPersistenceId-" + persistenceId) as Source <EventEnvelope, NotUsed>;
Exemple #4
0
 /// <summary>
 /// Same type of query as <see cref="EventsByTag"/> 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.
 /// </summary>
 public Source <EventEnvelope, NotUsed> CurrentEventsByTag(string tag, long offset) =>
 Source.ActorPublisher <EventEnvelope>(EventsByTagPublisher.Props(tag, offset, long.MaxValue, null, _maxBufferSize, _writeJournalPluginId))
 .MapMaterializedValue(_ => NotUsed.Instance)
 .Named("EventsByTag-" + tag);
 public Source <EventEnvelope, NotUsed> EventsByPersistenceId(string persistenceId, long fromSequenceNr = 0L, long toSequenceNr = long.MaxValue) =>
 Source.ActorPublisher <EventEnvelope>(EventsByPersistenceIdPublisher.Props(persistenceId, fromSequenceNr, toSequenceNr, _refreshInterval, _maxBufferSize, _writeJournalPluginId))
 .MapMaterializedValue(_ => NotUsed.Instance)
 .Named($"EventsByPersistenceId-{persistenceId}");
 public Source <string, NotUsed> PersistenceIds() =>
 // no polling for this query, the write journal will push all changes, i.e. no refreshInterval
 Source.ActorPublisher <string>(AllPersistenceIdsPublisher.Props(true, _writeJournalPluginId))
 .MapMaterializedValue(_ => NotUsed.Instance)
 .Named("PersistenceIds");
Exemple #7
0
 public static Source <Udp.Received, IActorRef> Create(EndPoint listenOn, int maxBufferSize) =>
 Source.ActorPublisher <Udp.Received>(Props(listenOn, maxBufferSize));
 public Source <string, NotUsed> PersistenceIds()
 {
     return(Source.ActorPublisher <string>(AllPersistenceIdsPublisher.Props(true, _writeJournalPluginId))
            .MapMaterializedValue(_ => NotUsed.Instance)
            .Named("AllPersistenceIds"));
 }
 /// <summary>
 /// Creates an Akka.NET Streams source stage that emits the <see cref="DurableEvent"/>s
 /// stored in <paramref name="eventLog"/>. The source also emits events that have been written to the event log after
 /// source creation. Behavior of the source can be configured with:
 ///
 ///  - `eventuate.log.replay-batch-size`. Maximum number of events to read from the event log when the internal
 ///    buffer (of same size) is empty.
 ///  - `eventuate.log.read-timeout`. Timeout for reading events from the event log.
 ///  - `eventuate.log.replay-retry-delay`. Delay between a failed read and the next read retry.
 /// </summary>
 /// <param name="eventLog">Source event log.</param>
 /// <param name="fromSequenceNr">A sequence number from where the [[DurableEvent]] stream should start.</param>
 /// <param name="aggregateId">
 /// if defined, emit only <see cref="DurableEvent"/>s with that aggregate id, otherwise, emit <see cref="DurableEvent"/>s
 /// with any aggregate id (see also http://rbmhtechnology.github.io/eventuate/reference/event-sourcing.html#event-routing).
 /// </param>
 public static Source <DurableEvent, IActorRef> Create(IActorRef eventLog, long fromSequenceNr = 0L, string aggregateId = null) =>
 Source.ActorPublisher <DurableEvent>(DurableEventSourceActor.Props(eventLog, fromSequenceNr, aggregateId));