Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
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));
 }