3 ms·
Ah right, I see. From the nginx wiki: > Unlike Apache's mod_lua and Lighttpd's mod_magnet, Lua code written atop this module can be 100% non-blocking on netwo
by skrebbel 15y ago
Ah right, I see.
From the nginx wiki:
> Unlike Apache's mod_lua and Lighttpd's mod_magnet, Lua code written atop this module can be 100% non-blocking on network traffic as long as you use the ngx.location.capture or ngx.location.capture_multi interfaces to let the nginx core do all your requests to mysql, postgresql, memcached, redis, upstream http web services, and etc etc etc (see HttpDrizzleModule, ngx_postgres, HttpMemcModule, HttpRedis2Module and HttpProxyModule modules for details).
Is that talk-via-nginx-commands thing cumbersome in practice?
- SomeCallMeTim 15y agoNo, it's pretty easy. An example: local doc = ngx.location.capture( "/couchdb/hamster/"..uid ); This queries the local CouchDB for a particular user record, and stores it in a local variable.