yev_loop_create()

yev_loop_create()#

yev_loop_create() initializes a new event loop associated with a given hgobj instance, allocating resources for event management.

Prototype

int yev_loop_create(
    hgobj          yuno,
    unsigned       entries,
    int           keep_alive,
    yev_callback_t callback,
    yev_loop_h    *yev_loop
);

Parameters

Key

Type

Description

yuno

hgobj

The hgobj instance associated with the event loop.

entries

unsigned

The maximum number of event entries the loop can handle.

keep_alive

int

Specifies whether the loop should persist after processing events.

callback

yev_callback_t

A callback function invoked for each event; returning -1 will break yev_loop_run().

yev_loop

yev_loop_h *

Pointer to store the created event loop handle.


Return Value

Returns 0 on success, or a negative value on failure.

Notes

If callback is NULL, a default callback will be used when processing events in yev_loop_run().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples