Пример #1
0
 public EmittedStream(
     string streamId, CheckpointTag zeroPosition, IPublisher publisher,
     IProjectionCheckpointManager readyHandler,
     int maxWriteBatchLength, ILogger logger = null)
 {
     if (streamId == null)
     {
         throw new ArgumentNullException("streamId");
     }
     if (publisher == null)
     {
         throw new ArgumentNullException("publisher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     if (streamId == "")
     {
         throw new ArgumentException("streamId");
     }
     _streamId            = streamId;
     _zeroPosition        = zeroPosition;
     _publisher           = publisher;
     _readyHandler        = readyHandler;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
 public ProjectionCheckpoint(
     IPublisher publisher,
     IODispatcher ioDispatcher,
     ProjectionVersion projectionVersion,
     IPrincipal runAs,
     IProjectionCheckpointManager readyHandler,
     CheckpointTag from,
     PositionTagger positionTagger,
     int maxWriteBatchLength,
     int maximumAllowedWritesInFlight,
     ILogger logger = null)
 {
     if (publisher == null) throw new ArgumentNullException("publisher");
     if (ioDispatcher == null) throw new ArgumentNullException("ioDispatcher");
     if (readyHandler == null) throw new ArgumentNullException("readyHandler");
     if (positionTagger == null) throw new ArgumentNullException("positionTagger");
     if (from.CommitPosition < from.PreparePosition) throw new ArgumentException("from");
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _maximumAllowedWritesInFlight = maximumAllowedWritesInFlight;
     _publisher = publisher;
     _ioDispatcher = ioDispatcher;
     _projectionVersion = projectionVersion;
     _runAs = runAs;
     _readyHandler = readyHandler;
     _positionTagger = positionTagger;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
     _writeQueueIds = Enumerable.Range(0, _maximumAllowedWritesInFlight).Select(x => Guid.NewGuid()).ToArray();
 }
Пример #3
0
 public ProjectionCheckpoint(
     RequestResponseDispatcher
         <ClientMessage.ReadStreamEventsBackward, ClientMessage.ReadStreamEventsBackwardCompleted> readDispatcher,
     RequestResponseDispatcher<ClientMessage.WriteEvents, ClientMessage.WriteEventsCompleted> writeDispatcher,
     ProjectionVersion projectionVersion, IPrincipal runAs, IProjectionCheckpointManager readyHandler,
     CheckpointTag from, PositionTagger positionTagger, CheckpointTag zero, int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (readDispatcher == null) throw new ArgumentNullException("readDispatcher");
     if (writeDispatcher == null) throw new ArgumentNullException("writeDispatcher");
     if (readyHandler == null) throw new ArgumentNullException("readyHandler");
     if (positionTagger == null) throw new ArgumentNullException("positionTagger");
     if (zero == null) throw new ArgumentNullException("zero");
     if (from.CommitPosition <= from.PreparePosition) throw new ArgumentException("from");
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _readDispatcher = readDispatcher;
     _writeDispatcher = writeDispatcher;
     _projectionVersion = projectionVersion;
     _runAs = runAs;
     _readyHandler = readyHandler;
     _positionTagger = positionTagger;
     _zero = zero;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
Пример #4
0
 public ProjectionCheckpoint(
     IPublisher publisher, IProjectionCheckpointManager readyHandler, CheckpointTag from, CheckpointTag zero, int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (publisher == null)
     {
         throw new ArgumentNullException("publisher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     if (zero == null)
     {
         throw new ArgumentNullException("zero");
     }
     if (from.CommitPosition <= from.PreparePosition)
     {
         throw new ArgumentException("from");
     }
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _publisher           = publisher;
     _readyHandler        = readyHandler;
     _zero                = zero;
     _from                = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger              = logger;
 }
 public ProjectionCheckpoint(
     IPublisher publisher, IProjectionCheckpointManager readyHandler, CheckpointTag from, CheckpointTag zero, int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (publisher == null) throw new ArgumentNullException("publisher");
     if (readyHandler == null) throw new ArgumentNullException("readyHandler");
     if (zero == null) throw new ArgumentNullException("zero");
     if (from.CommitPosition <= from.PreparePosition) throw new ArgumentException("from");
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _publisher = publisher;
     _readyHandler = readyHandler;
     _zero = zero;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
Пример #6
0
 public ProjectionCheckpoint(
     RequestResponseDispatcher
     <ClientMessage.ReadStreamEventsBackward, ClientMessage.ReadStreamEventsBackwardCompleted> readDispatcher,
     RequestResponseDispatcher <ClientMessage.WriteEvents, ClientMessage.WriteEventsCompleted> writeDispatcher,
     ProjectionVersion projectionVersion, IPrincipal runAs, IProjectionCheckpointManager readyHandler,
     CheckpointTag from, PositionTagger positionTagger, CheckpointTag zero, int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (readDispatcher == null)
     {
         throw new ArgumentNullException("readDispatcher");
     }
     if (writeDispatcher == null)
     {
         throw new ArgumentNullException("writeDispatcher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     if (positionTagger == null)
     {
         throw new ArgumentNullException("positionTagger");
     }
     if (zero == null)
     {
         throw new ArgumentNullException("zero");
     }
     if (from.CommitPosition <= from.PreparePosition)
     {
         throw new ArgumentException("from");
     }
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _readDispatcher    = readDispatcher;
     _writeDispatcher   = writeDispatcher;
     _projectionVersion = projectionVersion;
     _runAs             = runAs;
     _readyHandler      = readyHandler;
     _positionTagger    = positionTagger;
     _zero = zero;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
 public ProjectionCheckpoint(
     IODispatcher ioDispatcher, ProjectionVersion projectionVersion, IPrincipal runAs,
     IProjectionCheckpointManager readyHandler, CheckpointTag from, PositionTagger positionTagger,
     CheckpointTag zero, int maxWriteBatchLength, ILogger logger = null)
 {
     if (ioDispatcher == null) throw new ArgumentNullException("ioDispatcher");
     if (readyHandler == null) throw new ArgumentNullException("readyHandler");
     if (positionTagger == null) throw new ArgumentNullException("positionTagger");
     if (zero == null) throw new ArgumentNullException("zero");
     if (from.CommitPosition < from.PreparePosition) throw new ArgumentException("from");
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _ioDispatcher = ioDispatcher;
     _projectionVersion = projectionVersion;
     _runAs = runAs;
     _readyHandler = readyHandler;
     _positionTagger = positionTagger;
     _zero = zero;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
Пример #8
0
 public ProjectionCheckpoint(
     IODispatcher ioDispatcher,
     ProjectionVersion projectionVersion,
     IPrincipal runAs,
     IProjectionCheckpointManager readyHandler,
     CheckpointTag from,
     PositionTagger positionTagger,
     int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (ioDispatcher == null)
     {
         throw new ArgumentNullException("ioDispatcher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     if (positionTagger == null)
     {
         throw new ArgumentNullException("positionTagger");
     }
     if (from.CommitPosition < from.PreparePosition)
     {
         throw new ArgumentException("from");
     }
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _ioDispatcher      = ioDispatcher;
     _projectionVersion = projectionVersion;
     _runAs             = runAs;
     _readyHandler      = readyHandler;
     _positionTagger    = positionTagger;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }