From ee45cbf4498a3c1d1868469bdb0c767d66c278e4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 20:52:45 -0800 Subject: Endpoint dialer implemented. --- src/core/msgqueue.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/core/msgqueue.h') 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 -- cgit v1.2.3-70-g09d2