Skip to content

Commit 0747a04

Browse files
committed
doc: synopsis
1 parent b650a2e commit 0747a04

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This Nginx module is currently considered experimental.
3232
# Synopsis
3333

3434
```nginx
35-
# configure a thread pool.
35+
# configure a thread pool, with 16 threads and a task queue which size is 64k.
3636
thread_pool default threads=16 max_queue=65536;
3737
3838
http {
@@ -50,6 +50,7 @@ http {
5050
local file, err = ngx_io.open(filename, "r")
5151
assert(file and not err)
5252
53+
-- iterates the file by reading one line every time.
5354
for line in file:lines() do
5455
ngx.say(line)
5556
end
@@ -68,6 +69,7 @@ http {
6869
assert(file and not err)
6970
7071
while true do
72+
-- iterates the file by reading 512 bytes every time.
7173
local data, err = file:read(512)
7274
if err ~= nil then
7375
ngx.log(ngx.ERR, "file:read() error: ", err)
@@ -87,6 +89,7 @@ http {
8789
}
8890
8991
location /write {
92+
lua_io_write_buffer_size 4k;
9093
content_by_lua_block {
9194
local ngx_io = require "ngx.io"
9295

0 commit comments

Comments
 (0)