Open jean-airoldie opened 5 years ago
From my benchmarks creating a socket monitor that listens to all events has no performance impact.
It makes sense since:
send
calls on the PUB socketClosed by c6024c47d8e930bafd84876a3f881c1a6e29be7f
Nevermind the commit was reverted. Created a branch that supports monitoring experimentally.
I'm really unsure if I like socket monitoring tbh. Can't think of any real use case.
Support the
zmq_socket_monitored_versioned
API to retrieve events for sockets.My inital idea is to create a unique
monitor_addr
for each socket. Then we would callzmq_monitor_versioned
with this addr to create aZMQ_PUB
monitor socket. The we could create aSocketMonitor
which would leverage aZMQ_SUB
and subscribe to the appropriate events. It would then unpack the data into aSocketEvent
enum and feed it to a user provided closure. If there is no significant overhead, we should enable that by default.We could use the same API to create a event logger.
This is required to fix #19.