uv_handle_t is the base type for all libuv handle types.
Structures are aligned so that any libuv handle can be cast to uv_handle_t. All API functions defined here work with any handle type.
Libuv handles are not movable. Pointers to handle structures passed to functions must remain valid for the duration of the requested operation. Take care when using stack allocated handles.
The following API functions take a :cuv_handle_t
argument but they work just for some handle types.
The libuv event loop (if run in the default mode) will run until there are no active and referenced handles left. The user can force the loop to exit early by unreferencing handles which are active, for example by calling :cuv_unref
after calling :cuv_timer_start
.
A handle can be referenced or unreferenced, the refcounting scheme doesn't use a counter, so both operations are idempotent.
All handles are referenced when active by default, see :cuv_is_active
for a more detailed explanation on what being active involves.