Exemple #1
0
 public EmittedStream(
     string streamId, WriterConfiguration writerConfiguration, ProjectionVersion projectionVersion,
     PositionTagger positionTagger, CheckpointTag fromCheckpointPosition, IPublisher publisher,
     IODispatcher ioDispatcher,
     IEmittedStreamContainer readyHandler, bool noCheckpoints = false)
 {
     if (string.IsNullOrEmpty(streamId))
     {
         throw new ArgumentNullException("streamId");
     }
     if (writerConfiguration == null)
     {
         throw new ArgumentNullException("writerConfiguration");
     }
     if (positionTagger == null)
     {
         throw new ArgumentNullException("positionTagger");
     }
     if (fromCheckpointPosition == null)
     {
         throw new ArgumentNullException("fromCheckpointPosition");
     }
     if (publisher == null)
     {
         throw new ArgumentNullException("publisher");
     }
     if (ioDispatcher == null)
     {
         throw new ArgumentNullException("ioDispatcher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     _streamId                = streamId;
     _metadataStreamId        = SystemStreams.MetastreamOf(streamId);
     _writerConfiguration     = writerConfiguration;
     _projectionVersion       = projectionVersion;
     _writeAs                 = writerConfiguration.WriteAs;
     _positionTagger          = positionTagger;
     _zeroPosition            = positionTagger.MakeZeroCheckpointTag();
     _fromCheckpointPosition  = fromCheckpointPosition;
     _lastQueuedEventPosition = null;
     _publisher               = publisher;
     _ioDispatcher            = ioDispatcher;
     _readyHandler            = readyHandler;
     _maxWriteBatchLength     = writerConfiguration.MaxWriteBatchLength;
     _logger        = writerConfiguration.Logger;
     _noCheckpoints = noCheckpoints;
 }
Exemple #2
0
 public EmittedStream(
     string streamId, WriterConfiguration writerConfiguration, ProjectionVersion projectionVersion,
     PositionTagger positionTagger, CheckpointTag @from, IODispatcher ioDispatcher,
     IEmittedStreamContainer readyHandler, bool noCheckpoints = false)
 {
     if (streamId == null)
     {
         throw new ArgumentNullException("streamId");
     }
     if (writerConfiguration == null)
     {
         throw new ArgumentNullException("writerConfiguration");
     }
     if (positionTagger == null)
     {
         throw new ArgumentNullException("positionTagger");
     }
     if (@from == null)
     {
         throw new ArgumentNullException("from");
     }
     if (ioDispatcher == null)
     {
         throw new ArgumentNullException("ioDispatcher");
     }
     if (readyHandler == null)
     {
         throw new ArgumentNullException("readyHandler");
     }
     if (streamId == "")
     {
         throw new ArgumentException("streamId");
     }
     _streamId            = streamId;
     _writerConfiguration = writerConfiguration;
     _projectionVersion   = projectionVersion;
     _writeAs             = writerConfiguration.WriteAs;
     _positionTagger      = positionTagger;
     _zeroPosition        = positionTagger.MakeZeroCheckpointTag();
     _from = @from;
     _lastQueuedEventPosition = null;
     _ioDispatcher            = ioDispatcher;
     _readyHandler            = readyHandler;
     _maxWriteBatchLength     = writerConfiguration.MaxWriteBatchLength;
     _logger        = writerConfiguration.Logger;
     _noCheckpoints = noCheckpoints;
 }