"Blocks your chain on reading and parsing the HTTP request body" 是什么意思?
What does "Blocks your chain on reading and parsing the HTTP request body" mean?
我正在阅读 Node.JS restify。在其函数 bodyParser()
的定义下,它指出:
Blocks your chain on reading and parsing the HTTP request body. Switches on Content-Type and does the appropriate logic. application/json, application/x-www-form-urlencoded and multipart/form-data are currently supported.
我对 "blocks your chain on reading and parsing the HTTP request body" 的含义感到困惑。并且还对打开内容类型时需要执行的逻辑感到困惑
我的猜测是,这意味着它将推迟处理请求,直到读取并处理整个请求正文。这并不意味着它将阻塞事件循环,只是不会调用请求处理程序(以及正文解析器和请求处理程序之间的任何中间件)。我认为这是一个提醒,阅读和处理大型请求正文可能需要一些不平凡的时间。
使用 "the appropriate logic" 我假设它将为呈现正文的内容类型选择合适的解析器(url 编码,JSON, 多部分).
我正在阅读 Node.JS restify。在其函数 bodyParser()
的定义下,它指出:
Blocks your chain on reading and parsing the HTTP request body. Switches on Content-Type and does the appropriate logic. application/json, application/x-www-form-urlencoded and multipart/form-data are currently supported.
我对 "blocks your chain on reading and parsing the HTTP request body" 的含义感到困惑。并且还对打开内容类型时需要执行的逻辑感到困惑
我的猜测是,这意味着它将推迟处理请求,直到读取并处理整个请求正文。这并不意味着它将阻塞事件循环,只是不会调用请求处理程序(以及正文解析器和请求处理程序之间的任何中间件)。我认为这是一个提醒,阅读和处理大型请求正文可能需要一些不平凡的时间。
使用 "the appropriate logic" 我假设它将为呈现正文的内容类型选择合适的解析器(url 编码,JSON, 多部分).