From 877588b7448b2da2c6079c87528404e1f712e3e9 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 11 Dec 2016 18:50:50 -0800 Subject: Add operations on msgqueues. --- src/core/nng_impl.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/nng_impl.h') diff --git a/src/core/nng_impl.h b/src/core/nng_impl.h index a62ac101..683e0df1 100644 --- a/src/core/nng_impl.h +++ b/src/core/nng_impl.h @@ -80,9 +80,6 @@ extern int nni_msgqueue_create(nni_msgqueue_t *, int); */ extern void nni_msgqueue_destroy(nni_msgqueue_t); -extern int nni_msgqueue_len(nni_msgqueue_t); -extern int nni_msgqueue_cap(nni_msgqueue_t); - /* * nni_msgqueue_put attempts to put a message to the queue. It will wait * for the timeout (us), if the value is positive. If the value is negative @@ -102,4 +99,11 @@ extern int nni_msgqueue_put(nni_msgqueue_t, nng_msg_t, int); */ extern int nni_msgqueue_get(nni_msgqueue_t, nng_msg_t *, int); +/* + * nni_msgqueue_close closes the queue. After this all operates on the + * message queue will return NNG_ECLOSED. Messages inside the queue + * are freed. Unlike closing a go channel, this operation is idempotent. + */ +extern void nni_msgqueue_close(nni_msgqueue_t); + #endif /* NNG_IMPL_H */ -- cgit v1.2.3-70-g09d2