MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / _write

Method _write

packages/bench/src/backends.ts:186–198  ·  view source on GitHub ↗
(
    chunk: Buffer | string,
    encoding: BufferEncoding,
    callback: (error?: Error | null) => void,
  )

Source from the content-addressed store, hash-verified

184 private writeResolvers: Array<() => void> = [];
185
186 override _write(
187 chunk: Buffer | string,
188 encoding: BufferEncoding,
189 callback: (error?: Error | null) => void,
190 ): void {
191 this.writeCount++;
192 this.totalBytes +=
193 typeof chunk === "string" ? Buffer.byteLength(chunk, encoding) : chunk.byteLength;
194 this.writeTimes.push(performance.now());
195 const resolver = this.writeResolvers.shift();
196 if (resolver) resolver();
197 callback();
198 }
199
200 /**
201 * Returns a promise that resolves on the next _write call.

Callers

nothing calls this directly

Calls 3

callbackFunction · 0.85
byteLengthMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected