Diff

doc/net.server.lua @ 8781:53178b6ba589

net.server: Add watchfd, a simple API for watching file descriptors
author Kim Alvefur <zash@zash.se>
date Wed, 09 May 2018 16:15:40 +0200
parent 8728:41c959c5c84b
child 9295:6c7d2fb0d369
line wrap: on
line diff
--- a/doc/net.server.lua	Mon May 07 22:10:29 2018 +0200
+++ b/doc/net.server.lua	Wed May 09 16:15:40 2018 +0200
@@ -229,6 +229,18 @@
 local function hook_signal(signal_id, handler)
 end
 
+--[[ Adds a low-level FD watcher
+Arguments:
+-   fd_number: A non-negative integer representing a file descriptor or
+    object with a :getfd() method returning one
+-   on_readable: Optional callback for when the FD is readable
+-   on_writable: Optional callback for when the FD is writable
+
+Returns:
+-   net.server handle
+]]
+local function watchfd(fd_number, on_readable, on_writable)
+end
 
 return {
 	get_backend = get_backend;
@@ -240,4 +252,5 @@
 	addclient = addclient;
 	closeall = closeall;
 	hook_signal = hook_signal;
+	watchfd = watchfd;
 }