[zeromq-dev] zmq::socket_t::send blocking
Alexandre Quessy
aquessy at d-box.com
Mon Jan 23 16:27:31 CET 2017
Hi,
Thank you for pointing me to the specific section that is relevant for me. That’s great.
Now, this sentence is 57-word long, and I find it hard to read, since English is not my first language.
Here is a proposal of a rewrite in shorter sentences. I also avoid fancy words words like “shall”, or “high water mark” that non-native English readers might find tricky to understand. Please let me know if it is accurate or not. I would happily submit a merge request if you guys point me to the right Git repository for this API documentation. Here is my text:
If a socket is in ZMQ_PUSH mode, it will enter the mute state if ever its maximum threshold of messages in its downstream nodes is reached.
In mute state, if the socket has no downstream nodes, zmq_send(3) operations will block until the mute state ends.
As soon as there is a downstream node becomes available for sending, it will do it.
Messages are queued, therefore they will not be discarded.
By default, this function will block until it is done sending.
If the ZMQ_DONTWAIT flag is set, it will not block and do it later, in its I/O thread, in case it takes some time to do so.
Best,
ALEXANDRE QUESSY
Consultant software
D-BOX Technologies Inc. | A. 2172 de la Province, Longueuil, QC J4G 1R7 CANADA | T. 450-442-3003 | W. d-box.com<http://www.d-box.com>
De : zeromq-dev [mailto:zeromq-dev-bounces at lists.zeromq.org] De la part de Jens Auer
Envoyé : 20 janvier 2017 15:28
À : 'ZeroMQ development list' <zeromq-dev at lists.zeromq.org>
Objet : Re: [zeromq-dev] zmq::socket_t::send blocking
Hi,
quoting the manual from the link in Colin’s answer:
When a ZMQ_PUSH socket enters the mute state due to having reached the high water mark for all downstream nodes, or if there are no downstream nodes at all, then any zmq_send(3) operations on the socket shall block until the mute state ends or at least one downstream node becomes available for sending; messages are not discarded.
Best wishes,
Jens
Von: zeromq-dev [mailto:zeromq-dev-bounces at lists.zeromq.org] Im Auftrag von Alexandre Quessy
Gesendet: Freitag, 20. Januar 2017 20:00
An: ZeroMQ development list
Betreff: Re: [zeromq-dev] zmq::socket_t::send blocking
Hi,
ALEXANDRE QUESSY
Consultant software
D-BOX Technologies Inc. | A. 2172 de la Province, Longueuil, QC J4G 1R7 CANADA | T. 450-442-3003 | W. d-box.com<http://www.d-box.com>
De : zeromq-dev [mailto:zeromq-dev-bounces at lists.zeromq.org] De la part de Colin Ingarfield
Envoyé : 20 janvier 2017 12:04
À : ZeroMQ development list <zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>>
Objet : Re: [zeromq-dev] zmq::socket_t::send blocking
It depends on the type of socket and whether it has reached its HWM. Some types of socket will block, others will drop the message, others could enqueue it and return immediately.
The behavior for each type of socket is documented here: http://api.zeromq.org/4-0:zmq-socket
Thank you for your answer!
The socket is a inproc:// ZMQ_PUSH socket.
Will that block until the message is sent, if I don’t provide the ZMQ_DONTWAIT option?
Thanks!
On 1/20/17 11:00 AM, Alexandre Quessy wrote:
Hi
zmq::socket_t::send() - Is that blocking by default?
I need it to be blocking. (wait for the data to be sent before continuing)
If I set the flag ZMQ_DONTWAIT (formerly ZMQ_NOBLOCK) it should be non-blocking. So if I don’t set it, it should block?
Thank you,
ALEXANDRE QUESSY
Consultant software
D-BOX Technologies Inc. | A. 2172 de la Province, Longueuil, QC J4G 1R7 CANADA | T. 450-442-3003 | W. d-box.com<http://www.d-box.com>
AVIS : Ce courriel contient des renseignements confidentiels. Si vous n'êtes pas le véritable destinataire, la diffusion ou l'usage de ce courriel, des renseignements qu'il contient ou des documents qui lui sont joints pourrait être illégal. Il est donc strictement interdit de les diffuser ou de les utiliser. Si vous avez reçu ce courriel par erreur, nous vous saurions gré d’en aviser l'expéditeur immédiatement et de le supprimer sans le lire, l'imprimer, le sauvegarder ou le diffuser. Nous vous remercions de votre aimable collaboration.
NOTICE: This e-mail contains confidential information. If you are not the intended recipient, any disclosure or other use of this e-mail or the information contained herein or attached hereto may be unlawful and is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this e-mail without reading, printing, copying or forwarding it to anyone. Thank you for your kind cooperation.
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
________________________________
E-Mail ist virenfrei.
Von AVG überprüft - www.avg.com<http://www.avg.com/email-signature>
Version: 2016.0.7998 / Virendatenbank: 4749/13800 - Ausgabedatum: 19.01.2017
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170123/9ab517f0/attachment.htm>
More information about the zeromq-dev
mailing list