File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ This Nginx module is currently considered experimental.
32
32
# Synopsis
33
33
34
34
``` nginx
35
- # configure a thread pool.
35
+ # configure a thread pool, with 16 threads and a task queue which size is 64k .
36
36
thread_pool default threads=16 max_queue=65536;
37
37
38
38
http {
50
50
local file, err = ngx_io.open(filename, "r")
51
51
assert(file and not err)
52
52
53
+ -- iterates the file by reading one line every time.
53
54
for line in file:lines() do
54
55
ngx.say(line)
55
56
end
68
69
assert(file and not err)
69
70
70
71
while true do
72
+ -- iterates the file by reading 512 bytes every time.
71
73
local data, err = file:read(512)
72
74
if err ~= nil then
73
75
ngx.log(ngx.ERR, "file:read() error: ", err)
87
89
}
88
90
89
91
location /write {
92
+ lua_io_write_buffer_size 4k;
90
93
content_by_lua_block {
91
94
local ngx_io = require "ngx.io"
92
95
You can’t perform that action at this time.
0 commit comments