summaryrefslogtreecommitdiff
path: root/src/core/msgqueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/msgqueue.h')
-rw-r--r--src/core/msgqueue.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h
index d97482af..adea2dfa 100644
--- a/src/core/msgqueue.h
+++ b/src/core/msgqueue.h
@@ -15,8 +15,18 @@
// Message queues. Message queues work in some ways like Go channels;
// they are a thread-safe way to pass messages between subsystems. They
// do have additional capabilities though.
-typedef struct nni_msgqueue * nni_msgqueue_t;
-typedef struct nni_msgqueue nni_msgqueue;
+//
+// 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.)
+//
+// Message queues can be closed many times safely.
+//
+// Readers & writers in a message queue can be woken either by a timeout
+// or by a specific signal (arranged by the caller).
+//
+// TODO: Add message queue growing, and pushback.
+typedef struct nni_msgqueue nni_msgqueue;
// nni_msgqueue_create creates a message queue with the given capacity,
// which must be a positive number. It returns NNG_EINVAL if the capacity