lua-resty-thread
easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4)
$ opm get fesily/lua-resty-thread
lua-resty-thread
easy use to ngx.run_worker_thread, none block
Description
wrapper ngx.run_worker_thread
api, and support normally io api, like file
.
diffrence result
convert result if runtime error return, it's like this:
local ok, r1, ... = thread.run(...)
if not ok then
return nil, r1
end
return r1, ...
Public Functions
run()
pass callback function to ngx.run_worker_thread
without create a new file.
note: function must without up values.
run_worker_thread()
it's same as ngx.run_worker_thread
.
run_with_upvalues()
pass callback function to ngx.run_worker_thread
without create a new file.
note: upvalues list
must doesn't include
thread
userdata
c function
set_upvalues_maxlimit
function run_with_upvalues
serialize upvalues level limit.
new
banding argument threadpool_name
, all functions is same as resty.thread
except no first argument.
note:
if flag
support_thread
is false, return a wrapper object which all api will call functions in current thread.if thread pool is invalid, will return
nil, error message
| Filed | Name | Lua Type | Description | | ------------ | ----------------- | --------- | ---------------------------------------------------------------------- | | Parameter | threadpool_name
| string | thread pool name | | Parameter | no_check
| boolean | set true
will return wrapper object when thread pool is not invaild. | | Return Value | handle
| table/nil | instance reference |
support_thread
flag whether this function is supported.
Authors
Bing Han (fesil@foxmail.com)
License
apache2
Dependencies
openresty >= 1.21.4
Versions
-
fesily/lua-resty-thread 0.6.4easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-12 08:30:27
-
fesily/lua-resty-thread 0.6.3easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-12 08:28:36
-
fesily/lua-resty-thread 0.6.2easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-12 01:33:47
-
fesily/lua-resty-thread 0.6.1easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-11 08:44:00
-
fesily/lua-resty-thread 0.6.0easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-11 08:02:47
-
fesily/lua-resty-thread 0.5.0easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-11 07:40:09
-
fesily/lua-resty-thread 0.4.1easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-11 07:19:22
-
fesily/lua-resty-thread 0.4.0easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-11 07:13:55
-
fesily/lua-resty-thread 0.3.0easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-09 08:46:55
-
fesily/lua-resty-thread 0.2.0easy use to ngx.run_worker_thread, none block(openresty >= 1.21.4) 2022-07-09 03:07:26