ReadAsync(long, long, bool, LogDraftId?, CancellationToken)
abstract
public abstract IAsyncEnumerable<LogEvent<T>> ReadAsync(long fromSequence = 0, long epoch = 0, bool includeDrafts = false, LogDraftId? resumeDraftId = null, CancellationToken cancellationToken = default(CancellationToken)) Reads the log's committed entries from a position, then waits for new entries.
Parameters
fromSequencelong- The sequence number of the first entry to read.
epochlong- The epoch of the history which
fromSequencebelongs to, fromOrleans.Durable.Journaling.LogEvent.Epoch, or zero to read the current history. When the epoch differs fromOrleans.Durable.Journaling.IDurableLog.Epoch, the stream begins withLogEventKind. includeDraftsbool- Whether the stream also delivers draft events:
LogEventKind,LogEventKind, andLogEventKind. resumeDraftIdLogDraftId?- The draft a reconnecting reader which includes drafts was viewing. When the draft is still open, the stream repeats its items from the beginning. When it committed, the stream reports
LogEventKindwith the entries which replaced it, in any activation, while the log retains the first of those entries. When it closed in this activation without committing, the stream reportsLogEventKindwith itsLogDraftAbandonReason. Otherwise, the stream reportsLogDraftAbandonReasonfor a draft opened by another activation andLogDraftAbandonReasonfor a draft of this activation. cancellationTokenCancellationToken- The token which ends the read.
Returns
A stream of committed entries in sequence order. Each entry is delivered once the journal write which contains it is acknowledged. When
includeDrafts is true, the stream also delivers draft items as they are written, and reports a committed draft once the entries which replaced it are durable. Exceptions
System.ArgumentOutOfRangeExceptionfromSequenceorepochis negative.System.InvalidOperationException- Enumeration began before the owning manager recovered its state, or after a failed journal operation stopped it.
