Skip to content

Commit

Permalink
expose AsyncQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Arregui committed Sep 21, 2022
1 parent 20168bc commit c350ec9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions etc/pushable-channel.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@
```ts

// @public
export class AsyncQueue<T> implements AsyncGenerator<T> {
// (undocumented)
[Symbol.asyncIterator](): AsyncGenerator<T>;
constructor(requestingNext: (queue: AsyncQueue<T>, action: "next" | "close") => void);
// (undocumented)
close(error?: Error): void;
// (undocumented)
closed: boolean;
// (undocumented)
enqueue(value: T): void;
// (undocumented)
error: Error | undefined;
// (undocumented)
next(): Promise<IteratorResult<T>>;
// (undocumented)
return(value: any): Promise<IteratorResult<T>>;
// (undocumented)
settlers: {
enqueue: (value: {
resolve(x: IteratorResult<T>): void;
reject(error: Error): void;
}) => void;
dequeue: () => {
resolve(x: IteratorResult<T>): void;
reject(error: Error): void;
} | undefined;
isEmpty: () => boolean;
size: () => number;
};
// (undocumented)
throw(error: Error): Promise<IteratorResult<T>>;
// (undocumented)
values: {
enqueue: (value: IteratorResult<T, any>) => void;
dequeue: () => IteratorResult<T, any> | undefined;
isEmpty: () => boolean;
size: () => number;
};
}

// @public
export function linkedList<T>(): {
enqueue: (value: T) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { linkedList, pushableChannel } from "./push-channel"
export * from "./push-channel"

0 comments on commit c350ec9

Please sign in to comment.