diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-22 17:38:46 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-22 17:38:46 -0800 |
| commit | 89c847f1f52969ee2ae6ed35018eef40366ca061 (patch) | |
| tree | ba3f3c2da64e4a74c69d315b2198df59bcd4441b /src/core/msgqueue.h | |
| parent | 934c1316ae47754a2e368c65228c3cbfe552680f (diff) | |
| download | nng-89c847f1f52969ee2ae6ed35018eef40366ca061.tar.gz nng-89c847f1f52969ee2ae6ed35018eef40366ca061.tar.bz2 nng-89c847f1f52969ee2ae6ed35018eef40366ca061.zip | |
Work on endpoints. More C99 & type cleanups.
Diffstat (limited to 'src/core/msgqueue.h')
| -rw-r--r-- | src/core/msgqueue.h | 14 |
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 |
