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

Function callTimeout

lib/internal/http2/core.js:2563–2585  ·  view source on GitHub ↗
(self, session)

Source from the content-addressed store, hash-verified

2561}, 'http2Stream.priority is longer supported after priority signalling was deprecated in RFC 9113', 'DEP0194');
2562
2563function callTimeout(self, session) {
2564 // If the session is destroyed, this should never actually be invoked,
2565 // but just in case...
2566 if (self.destroyed)
2567 return;
2568 // This checks whether a write is currently in progress and also whether
2569 // that write is actually sending data across the write. The kHandle
2570 // stored `chunksSentSinceLastWrite` is only updated when a timeout event
2571 // happens, meaning that if a write is ongoing it should never equal the
2572 // newly fetched, updated value.
2573 if (self[kState].writeQueueSize > 0) {
2574 const handle = session[kHandle];
2575 const chunksSentSinceLastWrite = handle !== undefined ?
2576 handle.chunksSentSinceLastWrite : null;
2577 if (chunksSentSinceLastWrite !== null &&
2578 chunksSentSinceLastWrite !== handle.updateChunksSent()) {
2579 self[kUpdateTimer]();
2580 return;
2581 }
2582 }
2583
2584 self.emit('timeout');
2585}
2586
2587function callStreamClose(stream) {
2588 stream.close();

Callers 2

_onTimeoutMethod · 0.85
_onTimeoutMethod · 0.85

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…