Esempio n. 1
0
		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;
			}
		}
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
		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 ) );
		}
Esempio n. 5
0
 public TestBufferProducer(ITaskBuffer buffer, Type[] payloadTypes)
 {
     mTaskBuffer   = buffer;
     mPayloadTypes = payloadTypes;
 }
Esempio n. 6
0
 public TestBufferConsumer(ITaskBuffer taskBuffer)
 {
     mTaskBuffer = taskBuffer;
 }