You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently link function module subrequest is only supporting sequential call (sync), and it is still under beta version.
I will recommend you try to use aio threads to pass request into your apps layer, and make async(future) call in your apps. After that add the result into headers input for proxy request purpose.
Assume that you are using c++ application linking, there are many async http client in c/c++. such as Boost.Asio backcurl restclient-cpp.
voidbunchOfRequests(ngx_link_func_ctx_t* ctx) {
// ( "Async calling");
http.AsyncCall(.........);
// Request done, add to header for next requestngx_link_func_add_header_in(ctx, "myResult", strlen("myResult"), result->data, result->len);
ngx_link_func_add_header_in(ctx, "myResult2", strlen("myResult2"), result2->data, result2->len);
ngx_link_func_add_header_in(ctx, "myResult3", strlen("myResult3"), result3->data, result3->len);
// if you are proxy route to another, do not make response content, that's all !!
}
Taymindis
changed the title
how to make an aync call parallely before proxy to another server?
how to make an async call before proxy to another server?
Nov 29, 2018
Top picked emailed question:
I have a bunch of requests need to call at async and proxy the result to another server How can I do that?
The text was updated successfully, but these errors were encountered: