Skip to content

Commit 7b1f332

Browse files
committed
documented the new shdict:get_keys() API. also bumped version to 0.7.3.
1 parent f928fea commit 7b1f332

File tree

3 files changed

+57
-10
lines changed

3 files changed

+57
-10
lines changed

README

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Status
88
This module is under active development and is production ready.
99

1010
Version
11-
This document describes ngx_lua v0.7.2
12-
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 17
11+
This document describes ngx_lua v0.7.3
12+
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 30
1313
October 2012.
1414

1515
Synopsis
@@ -115,7 +115,7 @@ Synopsis
115115
location /foo {
116116
rewrite_by_lua '
117117
res = ngx.location.capture("/memc",
118-
{ args = { cmd = 'incr', key = ngx.var.uri } }
118+
{ args = { cmd = "incr", key = ngx.var.uri } }
119119
)
120120
';
121121

@@ -3955,6 +3955,26 @@ Nginx API for Lua
39553955

39563956
See also ngx.shared.DICT.flush_all and ngx.shared.DICT.
39573957

3958+
ngx.shared.DICT.get_keys
3959+
syntax: *keys = ngx.shared.DICT:get_keys(max_count?)*
3960+
3961+
context: *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*,
3962+
content_by_lua*, header_filter_by_lua*, body_filter_by_lua*,
3963+
log_by_lua**
3964+
3965+
Fetch a list of the keys from the dictionary, up to "<max_count>".
3966+
3967+
By default, only the first 1024 keys (if any) are returned. When the
3968+
"<max_count>" argument is given the value 0, then all the keys will be
3969+
returned even there is more than 1024 keys in the dictionary.
3970+
3971+
WARNING Be careful when calling this method on dictionaries with a
3972+
really huge number of keys. This method may lock the dictionary for
3973+
quite a while and block all the nginx worker processes that are trying
3974+
to access the dictionary.
3975+
3976+
This feature was first introduced in the "v0.7.3" release.
3977+
39583978
ngx.socket.udp
39593979
syntax: *udpsock = ngx.socket.udp()*
39603980

@@ -5661,5 +5681,5 @@ See Also
56615681
* The ngx_openresty bundle (<http://openresty.org>)
56625682

56635683
Translations
5664-
* Chinese
5684+
* Chinese (still in progress)
56655685

README.markdown

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This module is under active development and is production ready.
1818
Version
1919
=======
2020

21-
This document describes ngx_lua [v0.7.2](https://github.com/chaoslawful/lua-nginx-module/tags) released on 17 October 2012.
21+
This document describes ngx_lua [v0.7.3](https://github.com/chaoslawful/lua-nginx-module/tags) released on 30 October 2012.
2222

2323
Synopsis
2424
========
@@ -125,7 +125,7 @@ Synopsis
125125
location /foo {
126126
rewrite_by_lua '
127127
res = ngx.location.capture("/memc",
128-
{ args = { cmd = 'incr', key = ngx.var.uri } }
128+
{ args = { cmd = "incr", key = ngx.var.uri } }
129129
)
130130
';
131131

@@ -3617,6 +3617,20 @@ This feature was first introduced in the `v0.6.3` release.
36173617

36183618
See also [ngx.shared.DICT.flush_all](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.flush_all) and [ngx.shared.DICT](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT).
36193619

3620+
ngx.shared.DICT.get_keys
3621+
------------------------
3622+
**syntax:** *keys = ngx.shared.DICT:get_keys(max_count?)*
3623+
3624+
**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua**
3625+
3626+
Fetch a list of the keys from the dictionary, up to `<max_count>`.
3627+
3628+
By default, only the first 1024 keys (if any) are returned. When the `<max_count>` argument is given the value `0`, then all the keys will be returned even there is more than 1024 keys in the dictionary.
3629+
3630+
**WARNING** Be careful when calling this method on dictionaries with a really huge number of keys. This method may lock the dictionary for quite a while and block all the nginx worker processes that are trying to access the dictionary.
3631+
3632+
This feature was first introduced in the `v0.7.3` release.
3633+
36203634
ngx.socket.udp
36213635
--------------
36223636
**syntax:** *udpsock = ngx.socket.udp()*
@@ -4960,5 +4974,5 @@ See Also
49604974

49614975
Translations
49624976
============
4963-
* [Chinese](http://wiki.nginx.org/HttpLuaModuleZh)
4977+
* [Chinese](http://wiki.nginx.org/HttpLuaModuleZh) (still in progress)
49644978

doc/HttpLuaModule.wiki

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This module is under active development and is production ready.
1010

1111
= Version =
1212

13-
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.7.2] released on 17 October 2012.
13+
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.7.3] released on 30 October 2012.
1414

1515
= Synopsis =
1616
<geshi lang="nginx">
@@ -116,7 +116,7 @@ This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module
116116
location /foo {
117117
rewrite_by_lua '
118118
res = ngx.location.capture("/memc",
119-
{ args = { cmd = 'incr', key = ngx.var.uri } }
119+
{ args = { cmd = "incr", key = ngx.var.uri } }
120120
)
121121
';
122122
@@ -3494,6 +3494,19 @@ This feature was first introduced in the <code>v0.6.3</code> release.
34943494
34953495
See also [[#ngx.shared.DICT.flush_all|ngx.shared.DICT.flush_all]] and [[#ngx.shared.DICT|ngx.shared.DICT]].
34963496
3497+
== ngx.shared.DICT.get_keys ==
3498+
'''syntax:''' ''keys = ngx.shared.DICT:get_keys(max_count?)''
3499+
3500+
'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*''
3501+
3502+
Fetch a list of the keys from the dictionary, up to <code><max_count></code>.
3503+
3504+
By default, only the first 1024 keys (if any) are returned. When the <code><max_count></code> argument is given the value <code>0</code>, then all the keys will be returned even there is more than 1024 keys in the dictionary.
3505+
3506+
'''WARNING''' Be careful when calling this method on dictionaries with a really huge number of keys. This method may lock the dictionary for quite a while and block all the nginx worker processes that are trying to access the dictionary.
3507+
3508+
This feature was first introduced in the <code>v0.7.3</code> release.
3509+
34973510
== ngx.socket.udp ==
34983511
'''syntax:''' ''udpsock = ngx.socket.udp()''
34993512
@@ -4784,5 +4797,5 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
47844797
* [http://openresty.org The ngx_openresty bundle]
47854798
47864799
= Translations =
4787-
* [[HttpLuaModuleZh|Chinese]]
4800+
* [[HttpLuaModuleZh|Chinese]] (still in progress)
47884801

0 commit comments

Comments
 (0)