<div dir="ltr">Hi<div><br></div><div style>I want to have a filter header/body that makes an asynchronous call. On success, a completion handler is called. The result of this completion handler decides the output of filter header/body. I understand subrequest can be used to do this. But are there alternatives to this?</div>
<div style><br></div><div style>Lets say, I want to filter the body of the response to uppercase the body after 10 secs, how do I do that?</div><div style><br></div><div style>This is what I tried:</div><div style>1. In the body filter, create a timer, set the handler to my function, and return NGX_DONE</div>
<div style>2. In the handler, I call the next_body_filter</div><div style><br></div><div style>This works but there are edgecases that I am not sure how to handle, e.g. how to handle errors from next_body_filter, (specifically NGX_AGAIN) and so on. Pointers will be greatly appreciated.</div>
<div style><br></div><div style>Thanks!</div></div>