Skip to content

Commit 55f55ef

Browse files
authored
doc: improve grammar.
1 parent ea09d92 commit 55f55ef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ memory use. Request contexts are segregated using lightweight Lua coroutines.
269269
Loaded Lua modules persist in the Nginx worker process level resulting in a
270270
small memory footprint in Lua even when under heavy loads.
271271

272-
This module is plugged into Nginx's "http" subsystem so it can only speaks
272+
This module is plugged into Nginx's "http" subsystem so it can only speak
273273
downstream communication protocols in the HTTP family (HTTP 0.9/1.0/1.1/2.0,
274274
WebSockets, etc...). If you want to do generic TCP communications with the
275275
downstream clients, then you should use the
@@ -283,7 +283,7 @@ Typical Uses
283283

284284
Just to name a few:
285285

286-
* Mashup'ing and processing outputs of various Nginx upstream outputs (proxy, drizzle, postgres, redis, memcached, and etc) in Lua,
286+
* Mashup'ing and processing outputs of various Nginx upstream outputs (proxy, drizzle, postgres, redis, memcached, etc.) in Lua,
287287
* doing arbitrarily complex access control and security checks in Lua before requests actually reach the upstream backends,
288288
* manipulating response headers in an arbitrary way (by Lua)
289289
* fetching backend information from external storage backends (like redis, memcached, mysql, postgresql) and use that information to choose which upstream backend to access on-the-fly,
@@ -337,7 +337,7 @@ It is discouraged to build this module with Nginx yourself since it is tricky
337337
to set up exactly right.
338338

339339
Note that Nginx, LuaJIT, and OpenSSL official releases have various limitations
340-
and long standing bugs that can cause some of this module's features to be
340+
and long-standing bugs that can cause some of this module's features to be
341341
disabled, not work properly, or run slower. Official OpenResty releases are
342342
recommended because they bundle [OpenResty's optimized LuaJIT 2.1 fork](https://github.com/openresty/luajit2) and
343343
[Nginx/OpenSSL
@@ -421,7 +421,7 @@ While building this module either via OpenResty or with the Nginx core, you can
421421
* `NGX_LUA_USE_ASSERT`
422422
When defined, will enable assertions in the ngx_lua C code base. Recommended for debugging or testing builds. It can introduce some (small) runtime overhead when enabled. This macro was first introduced in the `v0.9.10` release.
423423
* `NGX_LUA_ABORT_AT_PANIC`
424-
When the LuaJIT VM panics, ngx_lua will instruct the current nginx worker process to quit gracefully by default. By specifying this C macro, ngx_lua will abort the current nginx worker process (which usually result in a core dump file) immediately. This option is useful for debugging VM panics. This option was first introduced in the `v0.9.8` release.
424+
When the LuaJIT VM panics, ngx_lua will instruct the current nginx worker process to quit gracefully by default. By specifying this C macro, ngx_lua will abort the current nginx worker process (which usually results in a core dump file) immediately. This option is useful for debugging VM panics. This option was first introduced in the `v0.9.8` release.
425425

426426
To enable one or more of these macros, just pass extra C compiler options to the `./configure` script of either Nginx or OpenResty. For instance,
427427

@@ -4149,7 +4149,7 @@ Then `GET /main` will give the output
41494149

41504150
Here, modification of the `ngx.ctx.blah` entry in the subrequest does not affect the one in the parent request. This is because they have two separate versions of `ngx.ctx.blah`.
41514151

4152-
Internal redirects (triggered by nginx configuration directives like `error_page`, `try_files`, `index` and etc) will destroy the original request `ngx.ctx` data (if any) and the new request will have an empty `ngx.ctx` table. For instance,
4152+
Internal redirects (triggered by nginx configuration directives like `error_page`, `try_files`, `index`, etc.) will destroy the original request `ngx.ctx` data (if any) and the new request will have an empty `ngx.ctx` table. For instance,
41534153

41544154
```nginx
41554155
@@ -8996,7 +8996,7 @@ this context.
89968996

89978997
You must notice that each timer will be based on a fake request (this fake request is also based on a fake connection). Because Nginx's memory release is based on the connection closure, if you run a lot of APIs that apply for memory resources in a timer, such as [tcpsock:connect](#tcpsockconnect), will cause the accumulation of memory resources. So it is recommended to create a new timer after running several times to release memory resources.
89988998

8999-
You can pass most of the standard Lua values (nils, booleans, numbers, strings, tables, closures, file handles, and etc) into the timer callback, either explicitly as user arguments or implicitly as upvalues for the callback closure. There are several exceptions, however: you *cannot* pass any thread objects returned by [coroutine.create](#coroutinecreate) and [ngx.thread.spawn](#ngxthreadspawn) or any cosocket objects returned by [ngx.socket.tcp](#ngxsockettcp), [ngx.socket.udp](#ngxsocketudp), and [ngx.req.socket](#ngxreqsocket) because these objects' lifetime is bound to the request context creating them while the timer callback is detached from the creating request's context (by design) and runs in its own (fake) request context. If you try to share the thread or cosocket objects across the boundary of the creating request, then you will get the "no co ctx found" error (for threads) or "bad request" (for cosockets). It is fine, however, to create all these objects inside your timer callback.
8999+
You can pass most of the standard Lua values (nils, booleans, numbers, strings, tables, closures, file handles, etc.) into the timer callback, either explicitly as user arguments or implicitly as upvalues for the callback closure. There are several exceptions, however: you *cannot* pass any thread objects returned by [coroutine.create](#coroutinecreate) and [ngx.thread.spawn](#ngxthreadspawn) or any cosocket objects returned by [ngx.socket.tcp](#ngxsockettcp), [ngx.socket.udp](#ngxsocketudp), and [ngx.req.socket](#ngxreqsocket) because these objects' lifetime is bound to the request context creating them while the timer callback is detached from the creating request's context (by design) and runs in its own (fake) request context. If you try to share the thread or cosocket objects across the boundary of the creating request, then you will get the "no co ctx found" error (for threads) or "bad request" (for cosockets). It is fine, however, to create all these objects inside your timer callback.
90009000

90019001
Please note that the timer Lua handler has its own copy of the `ngx.ctx` magic
90029002
table. It won't share the same `ngx.ctx` with the Lua handler creating the timer.
@@ -9489,7 +9489,7 @@ The type of `args` must be one of type below:
94899489
* nil
94909490
* table (the table may be recursive, and contains members of types above.)
94919491

9492-
The `ok` is in boolean type, which indicate the C land error (failed to get thread from thread pool, pcall the module function failed, .etc). If `ok` is `false`, the `res1` is the error string.
9492+
The `ok` is in boolean type, which indicate the C land error (failed to get thread from thread pool, pcall the module function failed, etc.). If `ok` is `false`, the `res1` is the error string.
94939493

94949494
The return values (res1, ...) are returned by invocation of the module function. Normally, the `res1` should be in boolean type, so that the caller could inspect the error.
94959495

0 commit comments

Comments
 (0)