MCPcopy Index your code
hub / github.com/nodejs/node / getServeAwait

Function getServeAwait

benchmark/async_hooks/async-resource-vs-destroy.js:136–145  ·  view source on GitHub ↗
(getCLS, setCLS)

Source from the content-addressed store, hash-verified

134}
135
136function getServeAwait(getCLS, setCLS) {
137 return async function serve(req, res) {
138 setCLS(Math.random());
139 await sleep(10);
140 await read(__filename);
141 if (res.destroyed) return;
142 res.setHeader('content-type', 'application/json');
143 res.end(JSON.stringify({ cls: getCLS() }));
144 };
145}
146
147function getServeCallbacks(getCLS, setCLS) {
148 return function serve(req, res) {

Callers

nothing calls this directly

Calls 7

setCLSFunction · 0.85
getCLSFunction · 0.85
randomMethod · 0.80
setHeaderMethod · 0.80
sleepFunction · 0.50
readFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…