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 
> <[email protected]> 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
> [email protected]
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to