MCPcopy
hub / github.com/fastify/fastify / cb

Function cb

lib/reply.js:897–912  ·  lib/reply.js::cb
(err, value)

Source from the content-addressed store, hash-verified

895
896 let cbAlreadyCalled = false
897 function cb (err, value) {
898 if (cbAlreadyCalled) return
899 cbAlreadyCalled = true
900 handled++
901
902 class="cm">// we can safely ignore error for trailer
903 class="cm">// since it does affect the client
904 class="cm">// we log in here only for debug usage
905 if (err) reply.log.debug(err)
906 else trailers[trailerName] = value
907
908 class="cm">// we push the check to the end of event
909 class="cm">// loop, so the registration continue to
910 class="cm">// process.
911 process.nextTick(send)
912 }
913
914 const result = reply[kReplyTrailers][trailerName](reply, payload, cb)
915 if (typeof result === class="st">'object' && typeof result.then === class="st">'function') {

Callers 14

injectFunction · 0.85
readyFunction · 0.85
fallbackErrorHandlerFunction · 0.85
exitFunction · 0.85
nextFunction · 0.85
handleRejectFunction · 0.85
sendTrailerFunction · 0.85
listenFunction · 0.85
web-api.test.jsFile · 0.85
stream.2.test.jsFile · 0.85
destroyFunction · 0.85
thenFunction · 0.85

Calls 1

debugMethod · 0.80

Tested by 2

destroyFunction · 0.68
thenFunction · 0.68