MCPcopy Create free account
hub / github.com/denoland/std / pull

Method pull

cbor/_byte_decoded_stream.ts:46–52  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

44 constructor(gen: AsyncGenerator<Uint8Array>, releaseLock: ReleaseLock) {
45 super({
46 async pull(controller) {
47 const { done, value } = await gen.next();
48 if (done) {
49 releaseLock();
50 controller.close();
51 } else controller.enqueue(value);
52 },
53 async cancel() {
54 // deno-lint-ignore no-empty
55 for await (const _ of gen) {}

Callers

nothing calls this directly

Calls 2

closeMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected