zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.95k stars 744 forks source link

NetMQ cancellation tokens support? #813

Closed Cassandra-d closed 5 years ago

Cassandra-d commented 5 years ago

What should I do if I want to stop send/receive operation at some specific moment of time as soon as possible?

I have a SubscriberSocket and I call TrySendFrame and TryReceiveFrameString. What I want is to be able to stop the operations earlier than timeout. Or be able to stop the operations with only cancellation token, then I'll be able to throw away timeout from the call.

Cancellation tokens are a natural way of stopping actions in .NET, especially for async code, it just feels unnecessary restricting when you can't use them along with timeouts.