コード例 #1
0
 public SpoolStreamProcessingWorkItem(
     ISpoolStreamWorkItemContainer container, IResultWriter resultWriter,
     ParallelProcessingLoadBalancer loadBalancer, EventReaderSubscriptionMessage.CommittedEventReceived message,
     SlaveProjectionCommunicationChannels slaves,
     SpooledStreamReadingDispatcher spoolProcessingResponseDispatcher, long limitingCommitPosition,
     Guid subscriptionId, Guid correlationId, bool definesCatalogTransform)
     : base(Guid.NewGuid())
 {
     if (resultWriter == null)
     {
         throw new ArgumentNullException("resultWriter");
     }
     if (slaves == null)
     {
         throw new ArgumentNullException("slaves");
     }
     if (spoolProcessingResponseDispatcher == null)
     {
         throw new ArgumentNullException("spoolProcessingResponseDispatcher");
     }
     _container    = container;
     _resultWriter = resultWriter;
     _loadBalancer = loadBalancer;
     _message      = message;
     _slaves       = slaves;
     _spoolProcessingResponseDispatcher = spoolProcessingResponseDispatcher;
     _limitingCommitPosition            = limitingCommitPosition;
     _subscriptionId          = subscriptionId;
     _correlationId           = correlationId;
     _definesCatalogTransform = definesCatalogTransform;
 }
コード例 #2
0
        public override void AssignSlaves(SlaveProjectionCommunicationChannels slaveProjections)
        {
            _slaves = slaveProjections;
            var workerCount = _slaves.Channels["slave"].Length;

            _loadBalancer = new ParallelProcessingLoadBalancer(
                workerCount, _maxScheduledSizePerWorker, _maxUnmeasuredTasksPerWorker);
        }