diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-26 14:10:09 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-26 15:57:48 -0800 |
| commit | 1ad7f88e0c58285c9e1cad9448d5a1fcfa7a07f1 (patch) | |
| tree | 9d11c07a6f65d5f5a0fb2ba80d916ec8f75cc2d0 /include | |
| parent | 07458cca6791b32215e28c4ac501630ca059e463 (diff) | |
| download | nng-1ad7f88e0c58285c9e1cad9448d5a1fcfa7a07f1.tar.gz nng-1ad7f88e0c58285c9e1cad9448d5a1fcfa7a07f1.tar.bz2 nng-1ad7f88e0c58285c9e1cad9448d5a1fcfa7a07f1.zip | |
aio: nng_aio_defer replaced by nng_aio_start
This represents an API change, and we remove the nng_aio_begin
function as well, introducing the lightweight nng_aio_reset instead.
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/nng.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h index 2563bc1e..b3daedb0 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -618,10 +618,10 @@ NNG_DECL void nng_aio_set_expire(nng_aio *, nng_time); // to succeed if n <= 4, otherwise it may fail due to NNG_ENOMEM. NNG_DECL int nng_aio_set_iov(nng_aio *, unsigned, const nng_iov *); -// nng_aio_begin is called by the provider to mark the operation as -// beginning. If it returns false, then the provider must take no -// further action on the aio. -NNG_DECL bool nng_aio_begin(nng_aio *); +// nng_aio_reset is called by the provider before doing other operations on the +// aio. Its purpose is to clear certain output fields, to avoid accidental +// reuse from prior operations on the aio. +NNG_DECL void nng_aio_reset(nng_aio *); // nng_aio_finish is used to "finish" an asynchronous operation. // It should only be called by "providers" (such as HTTP server API users). @@ -630,7 +630,7 @@ NNG_DECL bool nng_aio_begin(nng_aio *); // given aio. NNG_DECL void nng_aio_finish(nng_aio *, int); -// nng_aio_defer is used to register a cancellation routine, and indicate +// nng_aio_start is used to register a cancellation routine, and indicate // that the operation will be completed asynchronously. It must only be // called once per operation on an aio, and must only be called by providers. // If the operation is canceled by the consumer, the cancellation callback @@ -642,9 +642,9 @@ NNG_DECL void nng_aio_finish(nng_aio *, int); // to the reason for cancellation, e.g. NNG_ETIMEDOUT or NNG_ECANCELED. // This returns false if the operation cannot be deferred (because the AIO // has been stopped with nng_aio_stop.) If it does so, then the aio's -// completion callback will fire with a result of NNG_ECLOSED. +// completion callback will fire with a result of NNG_ESTOPPED. typedef void (*nng_aio_cancelfn)(nng_aio *, void *, int); -NNG_DECL bool nng_aio_defer(nng_aio *, nng_aio_cancelfn, void *); +NNG_DECL bool nng_aio_start(nng_aio *, nng_aio_cancelfn, void *); // nng_aio_sleep does a "sleeping" operation, basically does nothing // but wait for the specified number of milliseconds to expire, then |
