Keeping references in-process sockets for graceful exit #2069
Unanswered
jacopoabramo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently implementing an
in-proc
publisher-subscriber pattern usingzmq.devices.ThreadDevice
. A working example is presented below:The
VirtualBus
holds a weak reference to publisher sockets so that they can be manually closed whenshutdown
is called.This script works as intended, but it feels a bit unbalanced. Subscriber sockets are automatically closed when
zmq.ContextTerminated
is raised, and I wanted to know if there's a similar mechanism to also close publisher sockets in a similar fashion so that I don't have to keep references to them.Beta Was this translation helpful? Give feedback.
All reactions