erickt / rust-zmq

Rust zeromq bindings.
Apache License 2.0
900 stars 194 forks source link

Add Socket::disconnect method #169

Closed vorner closed 7 years ago

vorner commented 7 years ago

It is part of the C API and missing here.

The merge request is against the release/0.8 as adding a method should be API compatible change. Sorry I didn't open an issue for it upfront, I read the Contribution notes only after doing it, but I guess there's no other way the method could look like anyway and there's very little code written so it wouldn't matter if it would get thrown away.

As for motivation, I'd like to be able to shut down a worker gracefully, without losing messages in the input queue. If I disconnect first, I can process all messages in the queue and new ones won't arrive.