Add an option to a PULL/PUSH socket with ZeroMQ #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This Pull Request adds a
multi
option toZeroMQHandler
andZeroMQSubscriber
in order to allow several handlers to write on the same channel. This option is really useful, as several independent processes can log on the same channel, and a single subscriber can listen to all of them.I could have done it in my application by subclassing the handler and the subscriber (as it has been done before: https://github.com/zacharyvoase/logbook-zmqpush), but I think that this is a feature that could benefit to a lot of people, as logging via ZMQ really takes its sense when used with several processes, not just two.
The code could be simplified a little bit if #70 was merged, but it's not a big deal.
I'm using this code since a week with 5-6 processes writing a lot of debug simultaneously and it works fine.