MCPcopy Create free account
hub / github.com/nodejs/node / push

Method push

lib/internal/streams/iter/broadcast.js:123–140  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

121 }
122
123 push(...args) {
124 const { transforms, options } = parsePullArgs(args);
125 const rawConsumer = this.#createRawConsumer();
126
127 // When transforms are present, delegate to pull() which creates its
128 // own internal AbortController that follows the external signal.
129 // When no transforms, return rawConsumer directly (controller elided
130 // per PULL-02 optimization -- no transforms means no signal recipient).
131 if (transforms.length > 0) {
132 const pullArgs = [...transforms];
133 if (options?.signal) {
134 ArrayPrototypePush(pullArgs,
135 { __proto__: null, signal: options.signal });
136 }
137 return pullWithTransforms(rawConsumer, ...pullArgs);
138 }
139 return rawConsumer;
140 }
141
142 #createRawConsumer() {
143 const state = {

Callers 2

[kWrite]Method · 0.45
#createPendingWriteMethod · 0.45

Calls 2

#createRawConsumerMethod · 0.95
parsePullArgsFunction · 0.85

Tested by

no test coverage detected