Ejemplo n.º 1
0
        private static IStateWriter GetWriter(Store store, CheckpointKind checkpointKind)
        {
            return(new StateWriter(store, checkpointKind)
#if LOG
                   .WithLogging()
#endif
                   );
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new instance of <see cref="InMemoryStateWriter"/>.
 /// </summary>
 /// <param name="stateStore">The store where the state is persisted.</param>
 /// <param name="checkpointKind">The checkpoint kind.</param>
 /// <param name="onCommit">The action to be called when committing.</param>
 /// <param name="onRollback">The action to be called when rolling back.</param>
 public InMemoryStateWriter(
     InMemoryStateStore stateStore,
     CheckpointKind checkpointKind,
     Action onCommit   = null,
     Action onRollback = null)
 {
     _onRollback    = onRollback;
     _onCommit      = onCommit;
     _stateStore    = stateStore ?? throw new ArgumentNullException(nameof(stateStore));
     CheckpointKind = checkpointKind;
 }
Ejemplo n.º 3
0
 public StateStoreConnectionStateWriter(
     IReactiveStateStoreConnection connection,
     CheckpointKind checkpointKind,
     Action onCommit   = null,
     Action onRollback = null)
 {
     _connection    = connection ?? throw new ArgumentNullException(nameof(connection));
     _onCommit      = onCommit;
     _onRollback    = onRollback;
     _stagedChanges = new ConcurrentBag <StagedChange>();
     CheckpointKind = checkpointKind;
 }
 public CheckpointInfo(InMemoryStateStore store, CheckpointKind kind)
 {
     Store = store;
     Kind  = kind;
 }