Hello!
On Thu, Nov 15, 2012 at 5:38 AM, actioncao2012 wrote:
> Hi,
> I have not used openresty,How to use lua coroute to implement comet and
> write date to client?
All of the Lua code injected by rewrite_by_lua*, access_by_lua*, and
content_by_lua* is already running in a Lua coroutine created
automatically.
One way to implement comet servers atop ngx_lua, you can use redis's
pub/sub API with the lua-resty-redis library. You should also
configure the lua_check_client_abort directive (and possibly set a
callback for ngx.on_abort), as well as configuring TCP keepalive
properly in your system's TCP stack implementation.
Please check out the ngx_lua's official documentation for more details:
http://wiki.nginx.org/HttpLuaModule
Best regards,
-agentzh