yev_create_timer_event()

yev_create_timer_event()#

yev_create_timer_event() creates a new timer event associated with the specified event loop and callback function.

Prototype

yev_event_h yev_create_timer_event(
    yev_loop_h      yev_loop,
    yev_callback_t  callback,
    hgobj           gobj
);

Parameters

Key

Type

Description

yev_loop

yev_loop_h

The event loop handle in which the timer event will be created.

callback

yev_callback_t

The callback function to be invoked when the timer event triggers. If it returns -1, the loop in yev_loop_run() will break.

gobj

hgobj

The associated hgobj object for the event.


Return Value

Returns a yev_event_h handle to the newly created timer event, or NULL on failure.

Notes

The timer event must be started using yev_start_timer_event() before it becomes active.

Prototype

// Not applicable in JS

Prototype

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