(terminal: boolean, action: () => Promise<void>)
| 799 | } |
| 800 | |
| 801 | #run(terminal: boolean, action: () => Promise<void>): Promise<void> { |
| 802 | const task = this.#serial.then(async () => { |
| 803 | if (this.#completed) { |
| 804 | return; |
| 805 | } |
| 806 | if (!this.#started) { |
| 807 | this.#started = true; |
| 808 | await this.#exchange.startResponse({ status: 101, headers: {} }); |
| 809 | } |
| 810 | if (terminal) { |
| 811 | this.#completed = true; |
| 812 | } |
| 813 | await action(); |
| 814 | }); |
| 815 | this.#serial = task.catch(() => {}); |
| 816 | return task; |
| 817 | } |
| 818 | } |
no test coverage detected