* Sets the priority of the stream. * @param {StreamPriority} [options]
(options = kEmptyObject)
| 2451 | * @param {StreamPriority} [options] |
| 2452 | */ |
| 2453 | setPriority(options = kEmptyObject) { |
| 2454 | assertIsQuicStream(this); |
| 2455 | if (this.destroyed) return; |
| 2456 | if (!getQuicSessionState(this.#inner.session).isPrioritySupported) { |
| 2457 | throw new ERR_INVALID_STATE( |
| 2458 | 'The session does not support stream priority'); |
| 2459 | } |
| 2460 | validateObject(options, 'options'); |
| 2461 | const { |
| 2462 | level = 'default', |
| 2463 | incremental = false, |
| 2464 | } = options; |
| 2465 | validateOneOf(level, 'options.level', ['default', 'low', 'high']); |
| 2466 | validateBoolean(incremental, 'options.incremental'); |
| 2467 | const urgency = level === 'high' ? 0 : level === 'low' ? 7 : 3; |
| 2468 | this.#handle.setPriority((urgency << 1) | (incremental ? 1 : 0)); |
| 2469 | } |
| 2470 | |
| 2471 | /** |
| 2472 | * Send a block of headers. The headers are formatted as an array |
nothing calls this directly
no test coverage detected