zeromq/libzmq — pull request #426 by methodmissing (2012-09-25 00:40:57+00:00)
Title: Fix monitor

Addresses issues noted by the community in thread http://lists.zeromq.org/pipermail/zeromq-dev/2012-September/018577.html :

* Socket monitors aren't per context anymore - explicitly set per socket

* zmq_ctx_set_monitor replaced by a zmq_socket_monitor API

* zmq_socket_monitor spawns a PAIR socket and notifies over the inproc:// transport

* Socket events / state changes are passed as messages, effectively removing any runtime overhead from the I/O thread

* It's recommended to connect via a PAIR socket in another application thread and handle monitoring events there.

* zmq_socket_monitor supports a bitmask to filter events of interest

* First class "callback" API on socket_base - no more variable args magic and associated cross platform issues

* Subtle races conditions during shutdown avoided by stable message passing semantics

This is slightly more work for binding authors to implement, however it's also a more natural consumer API and there's enough freedom for handling the GIL in interpreted languages etc.

( once again this PULL request may be spawned against the wrong repo - I am always confused with zeromq3-x -> libzmq or vice versa for propagation )