コード例 #1
0
        public void Can_store_and_read_checkpoint(long?checkpoint)
        {
            _checkpointStore.Write(checkpoint);
            var returned = _checkpointStore.Read();

            returned.ShouldBe(checkpoint);
        }
コード例 #2
0
 public void Can_store_and_read_by_readonly(long?checkpoint)
 {
     _checkpointStore.Write(checkpoint);
     using (var readonlyStore = new CheckpointStore(_filePath, true))
     {
         var returned = readonlyStore.Read();
         returned.ShouldBe(checkpoint);
     }
 }
コード例 #3
0
        public CheckpointProjection(
            IStatefulProjection inner,
            CheckpointStore checkpointStore,
            Action <AllStreamPosition> notifyCheckpoint = null)
        {
            _inner            = inner;
            _checkpointStore  = checkpointStore;
            _notifyCheckpoint = notifyCheckpoint;

            _lastCheckpoint = _checkpointStore.Read();
            _notifyCheckpoint?.Invoke(AllStreamPosition.FromNullableInt64(_lastCheckpoint));
        }