yev_create_read_event()
#
yev_create_read_event()
creates a new read event associated with a given event loop, callback function, file descriptor, and buffer.
Prototype
yev_event_h yev_create_read_event(
yev_loop_h yev_loop,
yev_callback_t callback,
hgobj gobj,
int fd,
gbuffer_t * gbuf
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The event loop handle in which the read event will be registered. |
|
|
The function to be called when the read event is triggered. If it returns -1, the loop in |
|
|
The associated object that will handle the event. |
|
|
The file descriptor to monitor for read events. |
|
|
The buffer where the read data will be stored. |
Return Value
Returns a yev_event_h
handle to the newly created read event, or NULL
if the creation fails.
Notes
The event will be monitored for readability, and when data is available, the specified callback
function will be invoked.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples