webmcp
diff libraries/mondelefant/mondelefant_native.autodoc.lua @ 393:b2d2ff6e4385
Added <db_handle>:wait(...) method to wait for NOTIFYs
author | jbe |
---|---|
date | Wed Dec 09 03:40:27 2015 +0100 (2015-12-09) |
parents | a533ab6d7337 |
children | 912a1b9c2551 |
line diff
1.1 --- a/libraries/mondelefant/mondelefant_native.autodoc.lua Fri Dec 04 14:04:54 2015 +0100 1.2 +++ b/libraries/mondelefant/mondelefant_native.autodoc.lua Wed Dec 09 03:40:27 2015 +0100 1.3 @@ -25,6 +25,18 @@ 1.4 1.5 1.6 --[[-- 1.7 +<db_handle>.fd -- file descriptor of underlaying database connection 1.8 + 1.9 +The file descriptor number of the underlaying database connection. This value may be used in conjunction with :wait(0) and a select/poll system call to wait for several events at once. 1.10 + 1.11 +--]]-- 1.12 +-- set/unset in mondelefant_native.c in 1.13 +-- static int mondelefant_connect(lua_State *L) and 1.14 +-- static int mondelefant_close(lua_State *L) 1.15 +--//-- 1.16 + 1.17 + 1.18 +--[[-- 1.19 <db_handle>:close() 1.20 1.21 Closes the database connection. This method may be called multiple times and is called automatically when the database handle is garbage collected. 1.22 @@ -65,6 +77,22 @@ 1.23 1.24 1.25 --[[-- 1.26 +channel, -- notification channel name 1.27 +payload, -- notification payload string 1.28 +pid = -- process ID of notifying server process 1.29 +<db_handle>:wait( 1.30 + timeout -- number of seconds to wait, 0 = do not block, nil = wait infinitely 1.31 +) 1.32 + 1.33 +Waits for any NOTIFY event that is being LISTENed for. One or more LISTEN commands must have been sent previously with <db_handle>:query("LISTEN channel_name"). 1.34 + 1.35 +--]]-- 1.36 +-- implemented in mondelefant_native.c as 1.37 +-- static int mondelefant_conn_wait(lua_State *L) 1.38 +--//-- 1.39 + 1.40 + 1.41 +--[[-- 1.42 db_list = -- database result being an empty list 1.43 <db_handle>:create_list() 1.44