getify / revocable-queue

Specialized async queue data structure, supports revocation of values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a `close()` method to queues

getify opened this issue · comments

Calling close() on a queue closes it immediately, so that any further calls to that queue's push() will throw, and any calls to its next() will return functions that produce the RevocableQueue.EMPTY value.

This will be useful for an async-iterator wrapped around the queue.