UNPKG

@glamboyosa/chan

Version:

`@glamboyosa/chan` is a TypeScript package that implements channels similar to Go’s channels. Channels are a powerful concurrency primitive that enable safe and efficient communication between different parts of your application. This package is designed

13 lines (11 loc) 265 B
declare class Channel<T> { private bufferSize; private queue; private resolveQueue; private closed; constructor(bufferSize?: number); send(value: T): Promise<void>; receive(): Promise<T | null>; close(): void; } export { Channel };