1 Star 0 Fork 0

kuoyihp/nginx-lua-module-zh-wiki

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ngxsleep.md 892 Bytes
一键复制 编辑 原始数据 按行查看 历史
Lance Li 提交于 10年前 . 提交 ngxsleep.md

ngx.sleep

语法: ngx.sleep(seconds)

环境: rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*

无阻塞地休眠特定秒。时间可以精确到 0.001 秒 (毫秒)。

在后台,此方法使用 Nginx 的定时器。

自版本 0.7.20 开始,0 也可以作为时间参数被指定。

这个方法最早在版本 0.5.0rc30 中出现。

English Source

syntax: ngx.sleep(seconds)

context: rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*

Sleeps for the specified seconds without blocking. One can specify time resolution up to 0.001 seconds (i.e., one milliseconds).

Behind the scene, this method makes use of the Nginx timers.

Since the 0.7.20 release, The 0 time argument can also be specified.

This method was introduced in the 0.5.0rc30 release.

返回目录

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qizhendong_admin/nginx-lua-module-zh-wiki.git
git@gitee.com:qizhendong_admin/nginx-lua-module-zh-wiki.git
qizhendong_admin
nginx-lua-module-zh-wiki
nginx-lua-module-zh-wiki
master

搜索帮助