protected AbstractBatchedWorkItem( string id, WorkBatch batch, CancellationToken cancellationToken) { Id = id; Batch = batch; _cancellationToken = cancellationToken; }
public IWorkBatch Create(int workBatchSize, IWorkBatch yourBatch, IEnumerable preComputedResults = null, bool startup = false) { var batch = new WorkBatch(workBatchSize, yourBatch, preComputedResults); if (!startup) { return(batch); } if (_startupCreated) { throw new ApplicationException("You can only have one startup batch"); } _startupCreated = true; return(new StartupWorkBatch(batch, _startupBarrier)); }