aboutsummaryrefslogtreecommitdiff
path: root/src/core/msgqueue.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-22 20:52:45 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-22 20:52:45 -0800
commitee45cbf4498a3c1d1868469bdb0c767d66c278e4 (patch)
treeb9116256f12a54c90f92bf5cf215f3d4c8152126 /src/core/msgqueue.h
parent718de1828cc5b5256511c5b723360d499ae21c8f (diff)
downloadnng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.tar.gz
nng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.tar.bz2
nng-ee45cbf4498a3c1d1868469bdb0c767d66c278e4.zip
Endpoint dialer implemented.
Diffstat (limited to 'src/core/msgqueue.h')
-rw-r--r--src/core/msgqueue.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h
index adea2dfa..2684d42d 100644
--- a/src/core/msgqueue.h
+++ b/src/core/msgqueue.h
@@ -17,8 +17,8 @@
// do have additional capabilities though.
//
// A closed message queue cannot be written to, but if there are messages
-// still in it, it can be read from. (This allows them to play a role in
-// draining/lingering.)
+// 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.
//
@@ -84,4 +84,10 @@ extern void nni_msgqueue_signal(nni_msgqueue *, nni_signal *);
// are freed. Unlike closing a go channel, this operation is idempotent.
extern void nni_msgqueue_close(nni_msgqueue *);
+// nni_msgqueue_drain is like nng_msgqueue_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_msgqueue_drain(nni_msgqueue *, nni_time);
+
#endif // CORE_MSQUEUE_H