joselcvarela / await-q

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AwaitQ

Await pop value from queue. If is there, return it. Otherwise, wait until new value.

Example

import { AwaitQ } from "await-q";

const queue = new AwaitQ();

setTimeout(() => queue.push("await-q"), 5000);
const packageName = await queue.pop();

About


Languages

Language:JavaScript 100.0%