[#ASYNC_WAIT_CTX_set_callback]
= ASYNC&lowbar;WAIT&lowbar;CTX&lowbar;set&lowbar;callback
:mrdocs:

Register a callback notified when an engine completes an async operation&period;

== Synopsis

Declared in `&lt;openssl&sol;async&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
ASYNC&lowbar;WAIT&lowbar;CTX&lowbar;set&lowbar;callback(
    xref:ASYNC_WAIT_CTX.adoc[ASYNC&lowbar;WAIT&lowbar;CTX]* ctx,
    xref:ASYNC_callback_fn.adoc[ASYNC&lowbar;callback&lowbar;fn] callback,
    void* callback&lowbar;arg);
----

== Description

Prefer this when a wait file descriptor is too costly or unavailable&period; Pair with ASYNC&lowbar;WAIT&lowbar;CTX&lowbar;set&lowbar;status() so the engine can report ASYNC&lowbar;STATUS&lowbar;&ast; progress&period;

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Wait context that stores the callback&period;
| *callback*
| Function invoked from a poll or interrupt context&semi; must be small and nonblocking&period;
| *callback&lowbar;arg*
| User argument passed to `callback&period;`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
