Hi Raul,
I think the example at
https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html
is using a "while True" just for the sake of the example.
The main point is that the PUB socket is global, it is initialized once,
and then has a long-lifetime (basically it's deleted only when the program
exits).
I think that if you stick to this design criteria (instead of creating the
PUB socket, initialize and push data on that all the time you have
something to send) your issue will be solved :)

HTH,
Francesco

Il giorno gio 23 nov 2023 alle ore 11:29 Raúl Parada Medina <
raul.parada.med...@gmail.com> ha scritto:

> Hi,
>
> I've followed this tutorial, however, it includes the while True statement
> which I would like to avoid and it's more complex as required.
> Best,
> Raúl
>
> Missatge de Brett Viren <b...@bnl.gov> del dia dc., 22 de nov. 2023 a les
> 15:00:
>
>> Hi again,
>>
>> Perhaps copy-paste the example:
>>
>>
>> https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html
>>
>> and play with it to get some understanding of the socket lifetimes and
>> timing of the subscription phase.
>>
>> You might start with that code and modify it to get closer to what you
>> actually want and in the way will get past the blockers.
>>
>> -Brett.
>>
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to