From 6096172cf3630dbc5366a85fe89fb361b4f40fae Mon Sep 17 00:00:00 2001 From: gdamore Date: Sun, 27 Oct 2024 19:43:14 +0000 Subject: deploy: c699588c5e68880b8fd890711a4f7cca2b49a0bc --- ref/api/aio.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ref/api/aio.html') diff --git a/ref/api/aio.html b/ref/api/aio.html index fa90d946..e506a242 100644 --- a/ref/api/aio.html +++ b/ref/api/aio.html @@ -272,13 +272,13 @@ when the operation is complete (whether successfully or not). This callback will be executed exactly once.

The asynchronous I/O framework also supports cancellation of operations that are already in progress as well setting a maximum -timeout for them to complete.

-

It is also possible to initiate an asynchronous operation, and wait for it to +timeout for them to complete.

+

It is also possible to initiate an asynchronous operation, and wait for it to complete, creating a synchronous flow from an asynchronous one.

Create Handle

int nng_aio_alloc(nng_aio **aiop, void (*callb)(void *), void *arg);
 
-

The nng_aio_alloc function creates an nng_aio object, with the +

The nng_aio_alloc function creates an nng_aio object, with the callback callb taking the argument arg, and returns it in aiop.

If this succeeds, the function returns zero. Otherwise it may return NNG_ENOMEM.

@@ -288,7 +288,7 @@ complete, creating a synchronous flow from an asynchronous one.

The arg should normally be a structure that contains a pointer to the aiop, or from which it can be located. This allows callb to check the handle for -success using nng_aio_result, as well access other properties of aiop.

+success using nng_aio_result, as well access other properties of aiop.

@@ -328,7 +328,7 @@ If the operation is successfully canceled or aborted, then the callback will still be called.

The nng_aio_abort function aborts the operation associated with aio and returns immediately without waiting. If cancellation was successful, -then nng_aio_result will return err.

+then nng_aio_result will return err.

The nng_aio_cancel function acts like nng_aio_abort, but uses the error code NNG_ECANCELED.

The nng_aio_stop function aborts the aio operation with NNG_ECANCELED, @@ -376,7 +376,7 @@ function will not be called until the callback has completed.

important

The nng_aio_wait function should never be called from a function that itself -is a callback of an nng_aio, either this one or any other. +is a callback of an nng_aio, either this one or any other. Doing so may result in a deadlock.

Test for Completion

@@ -384,7 +384,7 @@ Doing so may result in a deadlock.

The nng_aio_busy function returns true if the aio is currently busy performing an operation or is executing a completion callback. Otherwise it return false. -This is the same test used internally by nng_aio_wait.

+This is the same test used internally by nng_aio_wait.

@@ -411,7 +411,7 @@ Operations that do not transfer data, or do not keep a count, may return zero fo

The return value from these functions is undefined if the operation has not completed yet. Either call these from the handle’s completion callback, or after waiting for the -operation to complete with nng_aio_wait.

+operation to complete with nng_aio_wait.

Messages

nng_msg *nng_aio_get_msg(nng_aio *aio);
@@ -460,14 +460,14 @@ The values pointed to by the iov_buf members are not copie
 

Most functions using nng_iov do not guarantee to transfer all of the data that they are requested to. To be sure that correct amount of data is transferred, as well as to start an attempt to complete any partial transfer, check the amount of data transferred by -calling nng_aio_count.

+calling nng_aio_count.

Inputs and Outputs

void nng_aio_set_input(nng_aio *aio, unsigned int index, void *param);
 void *nng_aio_get_output(nng_aio *aio, unsigned int index);
 

Asynchronous operations can take additional input parameters, and -provide additional result outputs besides the result code.

+provide additional result outputs besides the result code.

The nng_aio_set_input function sets the input parameter at index to param for the operation associated with aio.

The nng_aio_get_output function returns the output result at index -- cgit v1.2.3-70-g09d2