[zeromq-dev] Publish to and Read from a buffer

Jim Melton jim at melton.space
Wed Mar 18 06:31:42 CET 2020


Obviously, you have to make the decisions about what is best for your application, but I would suggest that ZMQ is for communicating data; what you do with it after you receive it is outside the scope of that.

What you may find useful is a polling loop (see https://pyzmq.readthedocs.io/en/latest/api/zmq.html#polling <https://pyzmq.readthedocs.io/en/latest/api/zmq.html#polling>). That way, you can service your subscriber sockets and have a timing mechanism to deal with time-based decisions.
--
Jim Melton




> On Mar 17, 2020, at 1:52 PM, Ziang Gao via zeromq-dev <zeromq-dev at lists.zeromq.org> wrote:
> 
> Hello,
> 
> I'm new to ZMQ and I recently started a project using the publisher and subscriber model. However, in my application, the client who's subscribing is making decisions based on the data collected during a small amount of time. Ideally, it would collect data for 1 sec then make a decision(during the decision-making period it would still be collecting data for the next decision), so I'm thinking that I can publish data into a buffer then grab all the data in there at a certain rate.
> 
> Does ZMQ provide a function or model that supports this kind of design? I know that I can create a buffer in a separate thread by myself and store the data there, but I would like to know if ZMQ had already provided a function for it before I'm heading that way. 
> 
> The language I'm using is Python and OS is Unbuntu 16.04.
> 
> Thank you very much!
> 
> Best regards,
> Ziang
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20200317/bb8007b4/attachment.htm>


More information about the zeromq-dev mailing list