Show / Hide Table of Contents

Interface IStateWriter

Provides capabilities to write an engine's state to a store.

Namespace: Reaqtor.QueryEngine
Assembly: Reaqtor.QueryEngine.Interfaces.dll
Syntax
public interface IStateWriter : IDisposable

Properties

CheckpointKind

The checkpoint kind.

  • For a full checkpoint, all items will be stored.
  • For a differential update, only items that have been modified since the last checkpoint will be stored.
Declaration
CheckpointKind CheckpointKind { get; }
Property Value
Type Description
CheckpointKind

Methods

CommitAsync(CancellationToken, IProgress<Int32>)

Commits the transaction.

Declaration
Task CommitAsync(CancellationToken token, IProgress<int> progress)
Parameters
Type Name Description
System.Threading.CancellationToken token

Cancellation token to observe cancellation requests.

System.IProgress<System.Int32> progress

(Optional) Progress indicator reporting progress percentages.

Returns
Type Description
System.Threading.Tasks.Task

Task to observe the eventual completion of the commit operation.

Remarks

Prior to calling this method, all item writer streams should be disposed.

DeleteItem(String, String)

Delete the item with the specified category and key from the store.

Declaration
void DeleteItem(string category, string key)
Parameters
Type Name Description
System.String category

The category of the item to delete.

System.String key

The key of the item to delete.

Remarks

Notes for implementers:

  • If the specified item does not exist, no exception should be thrown. All error reporting should be deferred until the call to CommitAsync(CancellationToken, IProgress<Int32>).
  • The deletion of the item should not be committed until a CommitAsync(CancellationToken, IProgress<Int32>) operation has been requested.

GetItemWriter(String, String)

Gets a writable stream to store the state for the item with the specified category and key.

Declaration
Stream GetItemWriter(string category, string key)
Parameters
Type Name Description
System.String category

The category of the item to obtain a stream for.

System.String key

The key of the item to obtain a stream for.

Returns
Type Description
System.IO.Stream

Stream used to store the state for the specified item.

Remarks

Notes for implementers:

  • The returned stream should not contain existing item content. Callers should expect a fresh stream to write to regardless of whether the requested item exists.
  • Writes to the returned stream should not be committed until a CommitAsync(CancellationToken, IProgress<Int32>) operation has been requested.

Rollback()

Discards all changes in the transaction.

Declaration
void Rollback()

Extension Methods

StateWriterExtensions.CommitAsync(IStateWriter)
StateWriterExtensions.CommitAsync(IStateWriter, CancellationToken)
StateWriterExtensions.CommitAsync(IStateWriter, IProgress<Int32>)
In This Article
Back to top Generated by DocFX