nginx lua body_filter_by_lua_block need to execute sleep API disabled in the context of content_by_lua*

174 views
Skip to first unread message

Nano NFi

unread,
Jan 31, 2019, 3:38:55 PM1/31/19
to openresty-en
I need to make body filter sleep before response


    location /configure/result.php {

           body_filter_by_lua_block   {
               --I am using ngx.arg[1] content return here if content contains somevalue then sleep
               --Need to execute sleep code before response =>
               ngx.sleep(60) --API disabled in the context of content_by_lua??
           }
        }
    }

But i cant execute sleep function in body filter API disabled in the context of content_by_lua* is there any other method i can use

I rebuild source code to be able to use sleep function in body filters but it did not work the error "no co ctx was found" some suggestions would really help me i found out that i can use the (echo_sleep 10.0;) from nginx but it does so before the content from server has been requested 

tokers

unread,
Feb 15, 2019, 4:08:36 AM2/15/19
to openresty-en
Hello!

Let the body filter phase supports these yield-able APIs need some
cooperations with other modules, say upstream module, for now, the
event pipe API doesn't have special processes when the output filter
returns NGX_AGAIN. Or maybe there are some other fancy mechanism
can achieve this goal :).

Basically There are still a lot of work should be done before we can use
these APIs in the body_filter_by_lua* phase.
Reply all
Reply to author
Forward
0 new messages