Purpose
The purpose of poll handles is to enable integrating external libraries that rely on the event loop to signal it about the socket status changes, like c-ares or libssh2. Using poll for any other purpose is not recommended.
new_poll¶
uv.new_poll( fd )
Initialize the handle using a file descriptor.
Parameters
none
Examples
local poll_handle = uv.new_poll( file_descriptor )
socket_poll¶
uv.socket_poll( socket )
Initialize the handle using a socket descriptor.
Parameters
none
Examples
local poll_handle = uv.socket_poll( socket )
poll_start¶
uv.poll_start( poll_handle, events, callback )
Initialize the handle using a socket descriptor.
Parameters
none
Examples
uv.poll_start( poll_handle, events, function() { print('polling started') } )
poll_stop¶
uv.poll_stop( poll_handle )
Stop polling the file descriptor, the callback will no longer be called.
Parameters
none
Examples
uv.poll_stop( poll_handle )
See also¶
The following API functionality applies to all handles: