Skip to content

CAPI app stopping #1521

Answered by cirospaciari
gigagrig asked this question in Q&A
Nov 15, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

@gigagrig

In my case i just use libuv to defer to me the close call, loop defer its not yet on C API.

You can get the native loop using:

    struct us_loop_t *uws_get_loop();
    struct us_loop_t *uws_get_loop_with_native(void* existing_native_loop);

uws_get_loop_with_nativebasically sets you the event loop and returns to you

    uv_loop_t *loop = (uv_loop_t *loop)uws_get_loop_with_native(uv_default_loop());

or

    uv_loop_t *loop =  ( uv_loop_t *)uws_get_loop();

and after this you can use any API of libuv like uv_prepare to close the API before pooling more IO, or uv_check to close the API after pooling more IO, if you want to call this from another thread (remembers that you can only ha…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gigagrig
Comment options

@cirospaciari
Comment options

@gigagrig
Comment options

Answer selected by gigagrig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants