NetMQ.NetMQPoller.StopAsync C# (CSharp) Method

StopAsync() public method

Stops the poller, returning immediately and most likely before the poller has actually stopped.
public StopAsync ( ) : void
return void
        public void StopAsync()
        {
            CheckDisposed();
            if (!IsRunning)
                throw new InvalidOperationException("NetMQPoller is not running");
            m_stopSignaler.RequestStop();
        }

Usage Example

Example #1
0
        public void Run(CancellationToken cancellationToken, params Task[] tasks)
        {
            var registration = cancellationToken.Register(() => m_poller.StopAsync(), false);

            Task.WhenAll(tasks).ContinueWith(t => m_poller.Stop(), cancellationToken);

            m_poller.Run(m_synchronizationContext);

            registration.Dispose();
        }