Skip to content

Commit 907d1d9

Browse files
chronolawzhuizhuhaomeng
authored andcommitted
doc: modified the todo section. we now have exit_worker_by_lua (#2009)
1 parent 297e73c commit 907d1d9

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

README.markdown

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,6 @@ TODO
974974
* cosocket: add configure options for different strategies of handling the cosocket connection exceeding in the pools.
975975
* review and apply vadim-pavlov's patch for [ngx.location.capture](#ngxlocationcapture)'s `extra_headers` option
976976
* use `ngx_hash_t` to optimize the built-in header look-up process for [ngx.req.set_header](#ngxreqset_header), [ngx.header.HEADER](#ngxheaderheader), and etc.
977-
* add directives to run Lua codes when Nginx stops.
978977
* add `ignore_resp_headers`, `ignore_resp_body`, and `ignore_resp` options to [ngx.location.capture](#ngxlocationcapture) and [ngx.location.capture_multi](#ngxlocationcapture_multi) methods, to allow micro performance tuning on the user side.
979978
* add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
980979
* add `stat` mode similar to [mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html).

doc/HttpLuaModule.wiki

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ phases.
809809
* cosocket: add configure options for different strategies of handling the cosocket connection exceeding in the pools.
810810
* review and apply vadim-pavlov's patch for [[#ngx.location.capture|ngx.location.capture]]'s <code>extra_headers</code> option
811811
* use <code>ngx_hash_t</code> to optimize the built-in header look-up process for [[#ngx.req.set_header|ngx.req.set_header]], [[#ngx.header.HEADER|ngx.header.HEADER]], and etc.
812-
* add directives to run Lua codes when Nginx stops.
813812
* add <code>ignore_resp_headers</code>, <code>ignore_resp_body</code>, and <code>ignore_resp</code> options to [[#ngx.location.capture|ngx.location.capture]] and [[#ngx.location.capture_multi|ngx.location.capture_multi]] methods, to allow micro performance tuning on the user side.
814813
* add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
815814
* add <code>stat</code> mode similar to [https://httpd.apache.org/docs/trunk/mod/mod_lua.html mod_lua].
@@ -1607,8 +1606,8 @@ Note that this handler always runs ''after'' the standard [[HttpRewriteModule]].
16071606
location /foo {
16081607
set $a 12; # create and initialize $a
16091608
set $b ""; # create and initialize $b
1610-
rewrite_by_lua_block {
1611-
ngx.var.b = tonumber(ngx.var.a) + 1
1609+
rewrite_by_lua_block {
1610+
ngx.var.b = tonumber(ngx.var.a) + 1
16121611
}
16131612
echo "res = $b";
16141613
}
@@ -1622,8 +1621,8 @@ On the other hand, the following will not work as expected:
16221621
? location /foo {
16231622
? set $a 12; # create and initialize $a
16241623
? set $b ''; # create and initialize $b
1625-
? rewrite_by_lua_block {
1626-
? ngx.var.b = tonumber(ngx.var.a) + 1
1624+
? rewrite_by_lua_block {
1625+
? ngx.var.b = tonumber(ngx.var.a) + 1
16271626
? }
16281627
? if ($b = '13') {
16291628
? rewrite ^ /bar redirect;
@@ -1698,8 +1697,8 @@ If the [[HttpRewriteModule]]'s [[HttpRewriteModule#rewrite|rewrite]] directive i
16981697
<geshi lang="nginx">
16991698
location /foo {
17001699
rewrite ^ /bar;
1701-
rewrite_by_lua_block {
1702-
ngx.exit(503)
1700+
rewrite_by_lua_block {
1701+
ngx.exit(503)
17031702
}
17041703
}
17051704
location /bar {
@@ -1892,8 +1891,8 @@ Here is an example of overriding a response header (or adding one if absent) in
18921891
<geshi lang="nginx">
18931892
location / {
18941893
proxy_pass http://mybackend;
1895-
header_filter_by_lua_block {
1896-
ngx.header.Foo = "blah"
1894+
header_filter_by_lua_block {
1895+
ngx.header.Foo = "blah"
18971896
}
18981897
}
18991898
</geshi>
@@ -1964,8 +1963,8 @@ The Lua code can pass its own modified version of the input data chunk to the do
19641963
<geshi lang="nginx">
19651964
location / {
19661965
proxy_pass http://mybackend;
1967-
body_filter_by_lua_block {
1968-
ngx.arg[1] = string.upper(ngx.arg[1])
1966+
body_filter_by_lua_block {
1967+
ngx.arg[1] = string.upper(ngx.arg[1])
19691968
}
19701969
}
19711970
</geshi>
@@ -2006,11 +2005,11 @@ When the Lua code may change the length of the response body, then it is require
20062005
location /foo {
20072006
# fastcgi_pass/proxy_pass/...
20082007
2009-
header_filter_by_lua_block {
2010-
ngx.header.content_length = nil
2008+
header_filter_by_lua_block {
2009+
ngx.header.content_length = nil
20112010
}
2012-
body_filter_by_lua_block {
2013-
ngx.arg[1] = string.len(ngx.arg[1]) .. "\n"
2011+
body_filter_by_lua_block {
2012+
ngx.arg[1] = string.len(ngx.arg[1]) .. "\n"
20142013
}
20152014
}
20162015
</geshi>
@@ -3688,8 +3687,8 @@ Lua tables can be used for both requests and responses when the number of subreq
36883687
table.insert(reqs, { "/memcached" })
36893688
36903689
-- issue all the requests at once and wait until they all return
3691-
local resps = {
3692-
ngx.location.capture_multi(reqs)
3690+
local resps = {
3691+
ngx.location.capture_multi(reqs)
36933692
}
36943693
36953694
-- loop over the responses table
@@ -5201,8 +5200,8 @@ For example,
52015200
52025201
<geshi lang="nginx">
52035202
location = /md5 {
5204-
content_by_lua_block {
5205-
ngx.say(ngx.md5("hello"))
5203+
content_by_lua_block {
5204+
ngx.say(ngx.md5("hello"))
52065205
}
52075206
}
52085207
</geshi>

0 commit comments

Comments
 (0)