| 48 | const kResume = Symbol('resume') |
| 49 | |
| 50 | class 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 | |
| 97 | class Request { |
| 98 | constructor (origin, { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…