summaryrefslogtreecommitdiff
path: root/docs/man
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2022-04-18 10:25:03 -0400
committerGarrett D'Amore <garrett@damore.org>2022-04-18 17:41:21 -0400
commit722bf4621703ef238fa81018f8c3e68bcef91354 (patch)
tree1389cd6082ecae9ab0db1239f48861ebefea3c4c /docs/man
parentd9897897fcf9d1276190b5d20955c72fd632acac (diff)
downloadnng-722bf4621703ef238fa81018f8c3e68bcef91354.tar.gz
nng-722bf4621703ef238fa81018f8c3e68bcef91354.tar.bz2
nng-722bf4621703ef238fa81018f8c3e68bcef91354.zip
fixes #1574 Non-blocking version of nng_aio_wait / nng_aio_result
This introduces a new API, nng_aio_busy(), that can be used to query the status of the aio without blocking. Some minor documentation fixes are included.
Diffstat (limited to 'docs/man')
-rw-r--r--docs/man/libnng.3.adoc1
-rw-r--r--docs/man/nng_aio_alloc.3.adoc4
-rw-r--r--docs/man/nng_aio_busy.3.adoc56
-rw-r--r--docs/man/nng_aio_wait.3.adoc5
4 files changed, 62 insertions, 4 deletions
diff --git a/docs/man/libnng.3.adoc b/docs/man/libnng.3.adoc
index 7475cdca..eaeae24d 100644
--- a/docs/man/libnng.3.adoc
+++ b/docs/man/libnng.3.adoc
@@ -164,6 +164,7 @@ The following functions are used in the asynchronous model:
|xref:nng_aio_abort.3.adoc[nng_aio_abort()]|abort asynchronous I/O operation
|xref:nng_aio_alloc.3.adoc[nng_aio_alloc()]|allocate asynchronous I/O handle
|xref:nng_aio_begin.3.adoc[nng_aio_begin()]|begin asynchronous I/O operation
+|xref:nng_aio_busy.3.adoc[nng_aio_busy()]|test if asynchronous I/O is busy
|xref:nng_aio_cancel.3.adoc[nng_aio_cancel()]|cancel asynchronous I/O operation
|xref:nng_aio_count.3.adoc[nng_aio_count()]|return number of bytes transferred
|xref:nng_aio_defer.3.adoc[nng_aio_defer()]|defer asynchronous I/O operation
diff --git a/docs/man/nng_aio_alloc.3.adoc b/docs/man/nng_aio_alloc.3.adoc
index 3a4a95e1..6a424e3b 100644
--- a/docs/man/nng_aio_alloc.3.adoc
+++ b/docs/man/nng_aio_alloc.3.adoc
@@ -1,6 +1,6 @@
= nng_aio_alloc(3)
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This document is supplied under the terms of the MIT License, a
@@ -37,7 +37,7 @@ This also means you should avoid operations such as allocating new objects,
which also means opening or closing sockets, dialers, and so forth.
TIP: If more complex or blocking work needs to be performed by _callb_, a separate
-thread can be used, along with a xref:nng_cv_alloc.3.adoc[condition variable]
+thread can be used, along with a xref:nng_cv_alloc.3supp.adoc[condition variable]
which can be signaled by the callback.
Asynchronous I/O operations all take an xref:nng_aio.5.adoc[`nng_aio`]
diff --git a/docs/man/nng_aio_busy.3.adoc b/docs/man/nng_aio_busy.3.adoc
new file mode 100644
index 00000000..4aaf09b5
--- /dev/null
+++ b/docs/man/nng_aio_busy.3.adoc
@@ -0,0 +1,56 @@
+= nng_aio_busy(3)
+//
+// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech>
+//
+// This document is supplied under the terms of the MIT License, a
+// copy of which should be located in the distribution where this
+// file was obtained (LICENSE.txt). A copy of the license may also be
+// found online at https://opensource.org/licenses/MIT.
+//
+
+== NAME
+
+nng_aio_busy - test if asynchronous I/O is busy
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+
+bool nng_aio_busy(nng_aio *aio);
+----
+
+== DESCRIPTION
+
+The `nng_aio_busy()` function returns true if the
+_aio_ is currently busy performing an asynchronous I/O
+operation or is executing a completion callback.
+
+If no operation has been started, or the operation has
+been completed or canceled, and any callback has been
+executed, then it returns false.
+
+This is the same test used internally by
+xref:nng_aio_wait.3.adoc[`nng_aio_wait()`]
+
+NOTE: Care should be taken to ensure that the _aio_ object is not
+freed when using this function. The caller is responsible for
+coordinating any use of this with any reuse of the _aio_.
+
+== RETURN VALUES
+
+True if the _aio_ is busy, false otherwise.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+xref:nng_aio_abort.3.adoc[nng_aio_abort(3)],
+xref:nng_aio_alloc.3.adoc[nng_aio_alloc(3)],
+xref:nng_aio_wait.3.adoc[nng_aio_wait(3)],
+xref:nng_aio.5.adoc[nng_aio(5)],
+xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_aio_wait.3.adoc b/docs/man/nng_aio_wait.3.adoc
index 5b65c79e..18b735db 100644
--- a/docs/man/nng_aio_wait.3.adoc
+++ b/docs/man/nng_aio_wait.3.adoc
@@ -1,6 +1,6 @@
= nng_aio_wait(3)
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2022 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This document is supplied under the terms of the MIT License, a
@@ -29,7 +29,7 @@ to complete.
If the operation has not been started, or has already
completed, then it returns immediately.
-If the a callback was set with _aio_ when it was allocated, then this
+If a callback was set with _aio_ when it was allocated, then this
function will not be called until the callback has completed.
== RETURN VALUES
@@ -45,5 +45,6 @@ None.
[.text-left]
xref:nng_aio_abort.3.adoc[nng_aio_abort(3)],
xref:nng_aio_alloc.3.adoc[nng_aio_alloc(3)],
+xref:nng_aio_busy.3.adoc[nng_aio_busy(3)],
xref:nng_aio.5.adoc[nng_aio(5)],
xref:nng.7.adoc[nng(7)]