aboutsummaryrefslogtreecommitdiff
path: root/src/core/msgqueue.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-04-14 12:46:15 -0700
committerGarrett D'Amore <garrett@damore.org>2018-04-14 12:46:15 -0700
commit5dfd550c68284438aeaacbaef815fc7d2f75f068 (patch)
treef6e1d0139e673f133cdcc4114977f5b67689c80d /src/core/msgqueue.h
parentc66ef25c7dfd0c2a3c4a8aa8eea223fa186c2311 (diff)
downloadnng-5dfd550c68284438aeaacbaef815fc7d2f75f068.tar.gz
nng-5dfd550c68284438aeaacbaef815fc7d2f75f068.tar.bz2
nng-5dfd550c68284438aeaacbaef815fc7d2f75f068.zip
fixes #308 Close can block
Ultimately, this just removes the support for lingering altogether. Based on prior experience, lingering has always been unreliable, and was removed in legacy libnanomsg ages ago. The problem is that operating system support for lingering is very inconsistent at best, and for some transports the very concept is somewhat meaningless. Making things worse, we were never able to adequately capture an exit() event from another thread -- so lingering was always a false promise. Applications that need to be sure that messages are delivered should either include an ack in their protocol, use req/rep (which has an ack), or inject a suitable delay of their own. For things going over local networks, an extra delay of 100 msec should be sufficient *most of the time*.
Diffstat (limited to 'src/core/msgqueue.h')
-rw-r--r--src/core/msgqueue.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h
index 9cc650e0..93a26eb6 100644
--- a/src/core/msgqueue.h
+++ b/src/core/msgqueue.h
@@ -17,10 +17,6 @@
// they are a thread-safe way to pass messages between subsystems. They
// do have additional capabilities though.
//
-// A closed message queue cannot be written to, but if there are messages
-// still in it and it is draining, it can be read from. This permits
-// linger operations to work.
-//
// Message queues can be closed many times safely.
//
// Readers & writers in a message queue can be woken either by a timeout
@@ -108,12 +104,6 @@ extern void nni_msgq_set_cb(nni_msgq *, nni_msgq_cb, void *);
// are freed. Unlike closing a go channel, this operation is idempotent.
extern void nni_msgq_close(nni_msgq *);
-// nni_msgq_drain is like nng_msgq_close, except that reads
-// against the queue are permitted for up to the time limit. The
-// operation blocks until either the queue is empty, or the timeout
-// has expired. Any messages still in the queue at the timeout are freed.
-extern void nni_msgq_drain(nni_msgq *, nni_time);
-
// nni_msgq_resize resizes the message queue; messages already in the queue
// will be preserved as long as there is room. Messages that are dropped
// due to no room are taken from the most recent. (Oldest messages are