-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lower Level Poller Pattern Question #596
Comments
We used to have something like that in the old poller, anyway I suggest two solutions:
|
@somdoron Thanks for replying so fast! Regarding the first suggestion: I'm still beginner with NetMQ, and I'm not feeling comfortable enough to PR, but if I come up with something good - I'll share. There's another thing that worries me about this approach: implementing lower-level API ( About the second approach I'll have to ask you for advice: We are talking about the system that should be able to handle 20,000+ messages per second. It means that I should start / stop poller 20,000+ times per second. Do you still think I can go this way? Thank you very much for trying to help! |
I've tried, but I'm far from understanding NetMQPoller.cs, so I'll give up on creating pr with RunOnce. I'll have to try with the second suggested approach. In any case I suggest you to consider adding some light-weight version of zmq_poll. NetMQPoller is obviously too massive (and too slow), and at the moment it is the only way to access some kind of polling. |
Here's the old https://github.com/zeromq/netmq/blob/932bf9d3e31090aa33ab495050c7b8f5a48a7ddb/src/NetMQ/Poller.cs
Would that implementation be light-weight enough for your requirement? It still uses much of the same machinery underneath. |
Thanks for trying to help! As far as I can see in the code, there would be no difference in performances if I implement RunOnce comparing to using the existing implementation and calling Stop as soon as the first event happen. So I'll do the later. I'm still afraid a bit that Thanks again! |
I've ran into problems with NetMQPoller and opened another issue: #598 |
This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions. |
Signalling my interest in a NetMQTimeout. Working through the zguide in F# using FsNetMQ. fszmq is now deprecated. |
In NetMQ poller is obviously implemented in NetMQPoller class, as "event-driven reactor". It's definitely easier pattern than original ZeroMQ implementation, but I've ran into a situation where I need lower level pattern (like mspoller from ZeroMQ guide). Basically I need to get a message (single message) from any of two receiver sockets (or to wait up to
timeout
for one to arrive). After that the thread should do some other work, and repeat cycle again (getting message -> other work), in an infinite loop. I hope that you understand what I need - it's actually the same exact thing as the linked example from above.Does NetMQ offer some lower-level poller API that would allow this? Any alternative approach?
Thanks!
The text was updated successfully, but these errors were encountered: