Interface ILogEntryConsumer<TEntry, TResult>
Represents reader of the log entries.
Namespace: DotNext.IO.Log
Assembly: DotNext.IO.dll
Syntax
public interface ILogEntryConsumer<in TEntry, TResult>
where TEntry : class, ILogEntry
Type Parameters
| Name | Description |
|---|---|
| TEntry | The interface type of the log entries supported by audit trail. |
| TResult | The type of the result produced by the reader. |
Remarks
This is an interface type instead of delegate type because it can be implemented by value type and avoid memory allocations.
Methods
| Improve this Doc View SourceReadAsync<TEntryImpl, TList>(TList, Nullable<Int64>, CancellationToken)
Reads log entries asynchronously.
Declaration
ValueTask<TResult> ReadAsync<TEntryImpl, TList>(TList entries, long? snapshotIndex, CancellationToken token)
where TEntryImpl : TEntry where TList : IReadOnlyList<TEntryImpl>
Parameters
| Type | Name | Description |
|---|---|---|
| TList | entries | The list of the log entries. |
| Nullable<Int64> | snapshotIndex | Non-null if the first log entry in this list is a snapshot entry that has the specific index. |
| CancellationToken | token | The token that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| ValueTask<TResult> | The result returned by the reader. |
Type Parameters
| Name | Description |
|---|---|
| TEntryImpl | The actual type of the log entries in the list. |
| TList | The type of the list containing log entries. |
Remarks
The actual generic types for TEntryImpl and TList
are supplied by the infrastructure automatically.
Do not return TEntryImpl as a part of TResult
because log entries are valid only during the call of this method.