Exemple #1
0
        internal ProjectionUpdateBatch(EventGraph events, DocumentSessionBase session, EventRange range)
        {
            Range    = range;
            _session = session;
            Queue    = new ActionBlock <IStorageOperation>(processOperation,
                                                           new ExecutionDataflowBlockOptions {
                MaxDegreeOfParallelism = 1, EnsureOrdered = true
            });

            startNewPage(session);

            var progressOperation = range.BuildProgressionOperation(events);

            Queue.Post(progressOperation);
        }
        internal ProjectionUpdateBatch(EventGraph events, DaemonSettings settings,
                                       DocumentSessionBase session, EventRange range, CancellationToken token, ShardExecutionMode mode)
        {
            Range     = range;
            _settings = settings;
            _session  = session;
            _token    = token;
            _mode     = mode;
            Queue     = new ActionBlock <IStorageOperation>(processOperation,
                                                            new ExecutionDataflowBlockOptions {
                MaxDegreeOfParallelism = 1, EnsureOrdered = true, CancellationToken = token
            });

            startNewPage(session);

            var progressOperation = range.BuildProgressionOperation(events);

            Queue.Post(progressOperation);
        }