예제 #1
0
        internal AbstractProducer(IThreadWrapper worker, IStartupBarrier startupBarrier = null)
        {
            _worker = worker;
            _worker.Setup(Loop,
                          cancellationToken =>
            {
                Startup(AddWork, cancellationToken);

                startupBarrier?.Wait(cancellationToken);
            });
        }
예제 #2
0
 public void DoFinally(WorkItemResult result, CancellationToken cancellationToken)
 {
     _workBatch.DoFinally(result, cancellationToken);
     _barrier?.Wait(cancellationToken);
 }