Skip to content

Commit

Permalink
docs: documented the new shdict:flush_expired() method. bumped the ve…
Browse files Browse the repository at this point in the history
…rsion to 0.6.3. also mentioned lua-resty-dns in the SEE ALSO section.
  • Loading branch information
agentzh committed Aug 26, 2012
1 parent f09867d commit a819a19
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 7 deletions.
27 changes: 24 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Status
This module is under active development and is production ready.

Version
This document describes ngx_lua v0.6.2
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 22
This document describes ngx_lua v0.6.3
(<https://github.com/chaoslawful/lua-nginx-module/tags>) released on 25
August 2012.

Synopsis
Expand Down Expand Up @@ -3613,6 +3613,8 @@ Nginx API for Lua

* flush_all

* flush_expired

Here is an example:

http {
Expand Down Expand Up @@ -3850,7 +3852,23 @@ Nginx API for Lua

This feature was first introduced in the "v0.5.0rc17" release.

See also ngx.shared.DICT.
See also ngx.shared.DICT.flush_expired and ngx.shared.DICT.

ngx.shared.DICT.flush_expired
syntax: *flushed = ngx.shared.DICT:flush_expired(max_count?)*

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**

Flushes out the expired items in the dictionary, up to the maximal
number specified by the optional "max_count" argument. When the
"max_count" argument is given 0 or not given at all, then it means
unlimited. Returns the number of items that have actually been flushed.

This feature was first introduced in the "v0.6.3" release.

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

ngx.socket.udp
syntax: *udpsock = ngx.socket.udp()*
Expand Down Expand Up @@ -5274,6 +5292,9 @@ See Also
* lua-resty-upload (<http://github.com/agentzh/lua-resty-upload>)
library based on ngx_lua cosocket.

* lua-resty-dns (<http://github.com/agentzh/lua-resty-dns>) library
based on ngx_lua cosocket.

* lua-resty-string (<http://github.com/agentzh/lua-resty-string>)
library based on LuaJIT FFI (<http://luajit.org/ext_ffi.html>).

Expand Down
18 changes: 16 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This module is under active development and is production ready.
Version
=======

This document describes ngx_lua [v0.6.2](https://github.com/chaoslawful/lua-nginx-module/tags) released on 22 August 2012.
This document describes ngx_lua [v0.6.3](https://github.com/chaoslawful/lua-nginx-module/tags) released on 25 August 2012.

Synopsis
========
Expand Down Expand Up @@ -3355,6 +3355,7 @@ The resulting object `dict` has the following methods:
* [incr](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.incr)
* [delete](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.delete)
* [flush_all](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.flush_all)
* [flush_expired](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.flush_expired)

Here is an example:

Expand Down Expand Up @@ -3544,7 +3545,19 @@ Flushes out all the items in the dictionary.

This feature was first introduced in the `v0.5.0rc17` release.

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

ngx.shared.DICT.flush_expired
-----------------------------
**syntax:** *flushed = ngx.shared.DICT:flush_expired(max_count?)*

**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**

Flushes out the expired items in the dictionary, up to the maximal number specified by the optional `max_count` argument. When the `max_count` argument is given `0` or not given at all, then it means unlimited. Returns the number of items that have actually been flushed.

This feature was first introduced in the `v0.6.3` release.

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).

ngx.socket.udp
--------------
Expand Down Expand Up @@ -4654,6 +4667,7 @@ See Also
* [lua-resty-redis](http://github.com/agentzh/lua-resty-redis) library based on ngx_lua cosocket.
* [lua-resty-mysql](http://github.com/agentzh/lua-resty-mysql) library based on ngx_lua cosocket.
* [lua-resty-upload](http://github.com/agentzh/lua-resty-upload) library based on ngx_lua cosocket.
* [lua-resty-dns](http://github.com/agentzh/lua-resty-dns) library based on ngx_lua cosocket.
* [lua-resty-string](http://github.com/agentzh/lua-resty-string) library based on [LuaJIT FFI](http://luajit.org/ext_ffi.html).
* [Routing requests to different MySQL queries based on URI arguments](http://openresty.org/#RoutingMySQLQueriesBasedOnURIArgs)
* [Dynamic Routing Based on Redis and Lua](http://openresty.org/#DynamicRoutingBasedOnRedis)
Expand Down
17 changes: 15 additions & 2 deletions doc/HttpLuaModule.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This module is under active development and is production ready.

= Version =

This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.6.2] released on 22 August 2012.
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.6.3] released on 25 August 2012.

= Synopsis =
<geshi lang="nginx">
Expand Down Expand Up @@ -3240,6 +3240,7 @@ The resulting object <code>dict</code> has the following methods:
* [[#ngx.shared.DICT.incr|incr]]
* [[#ngx.shared.DICT.delete|delete]]
* [[#ngx.shared.DICT.flush_all|flush_all]]
* [[#ngx.shared.DICT.flush_expired|flush_expired]]
Here is an example:
Expand Down Expand Up @@ -3422,7 +3423,18 @@ Flushes out all the items in the dictionary.
This feature was first introduced in the <code>v0.5.0rc17</code> release.
See also [[#ngx.shared.DICT|ngx.shared.DICT]].
See also [[#ngx.shared.DICT.flush_expired|ngx.shared.DICT.flush_expired]] and [[#ngx.shared.DICT|ngx.shared.DICT]].
== ngx.shared.DICT.flush_expired ==
'''syntax:''' ''flushed = ngx.shared.DICT:flush_expired(max_count?)''
'''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*''
Flushes out the expired items in the dictionary, up to the maximal number specified by the optional <code>max_count</code> argument. When the <code>max_count</code> argument is given <code>0</code> or not given at all, then it means unlimited. Returns the number of items that have actually been flushed.
This feature was first introduced in the <code>v0.6.3</code> release.
See also [[#ngx.shared.DICT.flush_all|ngx.shared.DICT.flush_all]] and [[#ngx.shared.DICT|ngx.shared.DICT]].
== ngx.socket.udp ==
'''syntax:''' ''udpsock = ngx.socket.udp()''
Expand Down Expand Up @@ -4482,6 +4494,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* [http://github.com/agentzh/lua-resty-redis lua-resty-redis] library based on ngx_lua cosocket.
* [http://github.com/agentzh/lua-resty-mysql lua-resty-mysql] library based on ngx_lua cosocket.
* [http://github.com/agentzh/lua-resty-upload lua-resty-upload] library based on ngx_lua cosocket.
* [http://github.com/agentzh/lua-resty-dns lua-resty-dns] library based on ngx_lua cosocket.
* [http://github.com/agentzh/lua-resty-string lua-resty-string] library based on [http://luajit.org/ext_ffi.html LuaJIT FFI].
* [http://openresty.org/#RoutingMySQLQueriesBasedOnURIArgs Routing requests to different MySQL queries based on URI arguments]
* [http://openresty.org/#DynamicRoutingBasedOnRedis Dynamic Routing Based on Redis and Lua]
Expand Down

0 comments on commit a819a19

Please sign in to comment.