response.atomic
how does it work, when should we use it?
#222
-
Question about
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, the From what I understand, the purpose of this method is to let HyperExpress automatically makes use of corking / this method internally wherever needed so you don't have to actually worry about using this method in any way unless you are doing something very low level and directly interacting with |
Beta Was this translation helpful? Give feedback.
Hello, the
Response.atomic
method is simply an alias of theuWS.HttpResponse.cork()
method.From what I understand, the purpose of this method is to let
uWebsockets.js
know that you intend to perform multiple Network operations such as write HTTP status, headers, body chunks etc etc in the Response. It is essentially a way to optimize and I think even required in the recent updates when doing async work souWebsockets.js
can batch these network write operations as much as possible especially for SSL.HyperExpress automatically makes use of corking / this method internally wherever needed so you don't have to actually worry about using this method in any way unless you are doing something …