protected void Dispose ( bool disposing ) { if ( !mIsDisposed ) { if ( disposing ) { //Ensure we have stopped StopAync().Wait(); //Clear wait handles mWaitForClearToFetchTask.Dispose(); mWaitForClearToFetchTask = null; //It is not our responsibility // to dispose of these dependencies // since we are not the owner and we // may interfere with their orchestration mTaskBuffer = null; mExecutorRegistry = null; mPayloadTypes = null; mStateController = null; mTaskQueueProducer = null; mTaskResultQueue = null; } mIsDisposed = true; } }
protected virtual void Dispose(bool disposing) { if (!mIsDisposed) { if (disposing) { //Ensure we have stopped StopAync().Wait(); //Clear wait handles mWaitForClearToDequeue.Dispose(); mWaitForClearToDequeue = null; mWaitForClearToAddToBuffer.Dispose(); mWaitForClearToAddToBuffer = null; //It is not our responsibility to dispose // of the queue and the buffer // since we are not the owner and we may // interfere with their orchestration mTaskBuffer = null; mTaskQueueConsumer = null; mRequiredPayloadTypes = null; mStateController = null; } mIsDisposed = true; } }
public StandardTaskPoller(TaskProcessingOptions options, ITaskQueueConsumer taskQueueConsumer, ITaskBuffer taskBuffer) { mOptions = options ?? throw new ArgumentNullException(nameof(options)); mTaskBuffer = taskBuffer ?? throw new ArgumentNullException(nameof(taskBuffer)); mTaskQueueConsumer = taskQueueConsumer ?? throw new ArgumentNullException(nameof(taskQueueConsumer)); }
public StandardTaskWorker ( TaskProcessingOptions options, ITaskBuffer taskBuffer, ITaskExecutorRegistry executorRegistry, IExecutionPerformanceMonitor performanceMonitor, ITaskQueueProducer taskQueueProducer, ITaskResultQueue taskResultQueue ) { mOptions = options ?? throw new ArgumentNullException( nameof( options ) ); mTaskBuffer = taskBuffer ?? throw new ArgumentNullException( nameof( taskBuffer ) ); mExecutorRegistry = executorRegistry ?? throw new ArgumentNullException( nameof( executorRegistry ) ); mPerformanceMonitor = performanceMonitor ?? throw new ArgumentNullException( nameof( performanceMonitor ) ); mTaskQueueProducer = taskQueueProducer ?? throw new ArgumentNullException( nameof( taskQueueProducer ) ); mTaskResultQueue = taskResultQueue ?? throw new ArgumentNullException( nameof( taskResultQueue ) ); }
public TestBufferProducer(ITaskBuffer buffer, Type[] payloadTypes) { mTaskBuffer = buffer; mPayloadTypes = payloadTypes; }
public TestBufferConsumer(ITaskBuffer taskBuffer) { mTaskBuffer = taskBuffer; }