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

Method setPriority

lib/internal/quic/quic.js:2453–2469  ·  view source on GitHub ↗

* Sets the priority of the stream. * @param {StreamPriority} [options]

(options = kEmptyObject)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

setPriorityMethod · 0.65

Tested by

no test coverage detected