Skip to content

ILogViewUpdate<TLogEntry> Methods

Interface for updating the log.

ClearLogAsync(CancellationToken)

virtual
View source
public virtual Task ClearLogAsync(CancellationToken cancellationToken)
Clear the log stream completely. Throws System.NotSupportedException if the log stream does not support clearing.

Parameters

cancellationTokenCancellationToken
A cancellation token to cancel the operation.

Returns

A task that represents the asynchronous clear operation.

ConfirmSubmittedEntries

abstract
public abstract Task ConfirmSubmittedEntries()
Confirm all submitted entries.

Waits until all previously submitted entries appear in the confirmed prefix of the log.

Returns

A task that completes after all entries are confirmed.

Submit(TLogEntry)

abstract
public abstract void Submit(TLogEntry entry)
Submit a single log entry to be appended to the global log, either at the current or at any later position.

Parameters

entryTLogEntry

SubmitRange(IEnumerable<TLogEntry>)

abstract
public abstract void SubmitRange(IEnumerable<TLogEntry> entries)
Submit a range of log entries to be appended atomically to the global log, either at the current or at any later position.

Parameters

entriesIEnumerable<TLogEntry>

Synchronize

abstract
public abstract Task Synchronize()
Get the latest log view and confirm all submitted entries.

Waits until all previously submitted entries appear in the confirmed prefix of the log, and forces a refresh of the confirmed prefix.

Returns

A task that completes after getting the latest version and confirming all entries.

TryAppend(TLogEntry)

abstract
public abstract Task<bool> TryAppend(TLogEntry entry)
Try to append a single log entry at the current position of the log.

Parameters

entryTLogEntry

Returns

true if the entry was appended successfully, or false if there was a concurrency conflict (i.e. some other entries were previously appended).

TryAppendRange(IEnumerable<TLogEntry>)

abstract
public abstract Task<bool> TryAppendRange(IEnumerable<TLogEntry> entries)
Try to append a range of log entries atomically at the current position of the log.

Parameters

entriesIEnumerable<TLogEntry>

Returns

true if the entries were appended successfully, or false if there was a concurrency conflict (i.e. some other entries were previously appended).