MCPcopy
hub / github.com/nodejs/undici / RequestController

Class RequestController

lib/core/request.js:50–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48const kResume = Symbol('resume')
49
50class RequestController {
51 #paused = false
52 #reason = null
53 #aborted = false
54 #abort
55
56 [kResume] = null
57
58 rawHeaders = null
59 rawTrailers = null
60
61 constructor (abort) {
62 this.#abort = abort
63 }
64
65 pause () {
66 this.#paused = true
67 }
68
69 resume () {
70 if (this.#paused) {
71 this.#paused = false
72 this[kResume]?.()
73 }
74 }
75
76 abort (reason) {
77 if (!this.#aborted) {
78 this.#aborted = true
79 this.#reason = reason
80 this.#abort(reason)
81 }
82 }
83
84 get aborted () {
85 return this.#aborted
86 }
87
88 get reason () {
89 return this.#reason
90 }
91
92 get paused () {
93 return this.#paused
94 }
95}
96
97class Request {
98 constructor (origin, {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…