Skip to content

Commit

Permalink
fix(node:stream): support asyncDispose for readable
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 22, 2023
1 parent 16f6150 commit f8f8f46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/runtime/node/stream/readable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ export class _Readable extends EventEmitter implements stream.Readable {

async *[Symbol.asyncIterator](): AsyncIterableIterator<any> {}

[Symbol.asyncDispose]() {
this.destroy();
return Promise.resolve();
}

compose<T extends NodeJS.ReadableStream>(
stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>,
options?: { signal: AbortSignal } | undefined,
Expand Down

0 comments on commit f8f8f46

Please sign in to comment.