NetMQ.Poller.CancelAndJoin C# (CSharp) Method

CancelAndJoin() public method

Cancel the poller job when PollTillCancelled is called and wait for the PollTillCancelled to complete
public CancelAndJoin ( ) : void
return void
        public void CancelAndJoin()
        {
            Cancel(true);
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Release any contained resources.
        /// </summary>
        /// <param name="disposing">set this to true if releasing managed resources</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            if (!m_ownPoller && !m_poller.IsStarted)
            {
                DisposeSynced();
                return;
            }

            // disposing on the scheduler thread
            var task = new Task(DisposeSynced);

            task.Start(this);
            task.Wait();

            // poller cannot be stopped from poller thread
            if (m_ownPoller)
            {
                m_poller.CancelAndJoin();
                m_poller.Dispose();
            }
            m_isSchedulerThread.Dispose();
        }
All Usage Examples Of NetMQ.Poller::CancelAndJoin