异步非阻塞的实现关键
nginx能保持全异步的事件驱动框架,关键在于各种callback函数,这些增加了编码的难度,但是却能够保证nginx进程在执行的过程中,不会因为一个阻塞的调用导致进程进入休眠状态。
ngx_http_client_body_handler_pt
描述: nginx在接受完完整的请求body后回调该函数。
调用: ngx_http_read_client_request_body()函数用于读取请求body,读取完毕之后,post_hander回调方法会被调用。
ngx_int_t
ngx_http_read_client_request_body(ngx_http_request_t *r,
ngx_http_client_body_handler_pt post_handler)
{
}