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

Method canWriteSync

lib/internal/streams/iter/push.js:135–144  ·  view source on GitHub ↗

* Check if a sync write would be accepted. * @returns {boolean}

()

Source from the content-addressed store, hash-verified

133 * @returns {boolean}
134 */
135 canWriteSync() {
136 if (this.#writerState !== 'open') return false;
137 if (this.#consumerState !== 'active') return false;
138 if ((this.#backpressure === 'strict' ||
139 this.#backpressure === 'block') &&
140 this.#slots.length >= this.#highWaterMark) {
141 return false;
142 }
143 return true;
144 }
145
146 /**
147 * Write chunks synchronously if possible.

Callers 2

writeMethod · 0.80
writevMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected