@esfx/async-waitqueue
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@esfx/async-waitqueue

The @esfx/async-waitqueue package provides the WaitQueue class, an async coordination primitive used to queue and resolve promises.

Overview

Installation

npm i @esfx/async-waitqueue

Usage

import { WaitQueue } from "@esfx/async-waitqueue";

async function main() {
    const queue = new WaitQueue();

    // Create two pending "waiters" in the queue
    const p1 = queue.wait();
    const p2 = queue.wait();

    // Resolve the two pending "waiters" in the queue
    queue.resolveOne(1);
    queue.resolveOne(2);

    await p1; // 1
    await p2; // 2
}

API

You can read more about the API here.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.0436latest
1.1.0-alpha.2023072603220next
1.0.0-dev.80dev

Version History

VersionDownloads (Last 7 Days)Published
1.1.0-alpha.2023072603220
1.1.0-alpha.2023060802531
1.1.0-alpha.2023060614060
1.1.0-alpha.2023060613160
1.1.0-alpha.2023060512280
1.1.0-alpha.2023050821040
1.1.0-alpha.2023020917150
1.1.0-alpha.2023020719350
1.1.0-alpha.2022112914460
1.1.0-alpha.2022112215090
1.1.0-alpha.2022102521390
1.0.0436
1.0.0-dev.80
1.0.0-dev.70
1.0.0-dev.60
1.0.0-dev.50
1.0.0-pre.440
1.0.0-dev.40
1.0.0-pre.430
1.0.0-pre.420
1.0.0-pre.410
1.0.0-pre.400
1.0.0-pre.397
1.0.0-prenative.10
1.0.0-pre.380
1.0.0-dev.00
1.0.0-pre.370
1.0.0-pre.360
1.0.0-pre.350
1.0.0-pre.340
1.0.0-pre.330
1.0.0-pre.310
1.0.0-prenative.00
1.0.0-pre.301
1.0.0-pre.290
1.0.0-pre.280
1.0.0-pre.261
1.0.0-pre.250
1.0.0-pre.240
1.0.0-pre.230
1.0.0-pre.190
1.0.0-pre.170
1.0.0-pre.160
1.0.0-pre.132
1.0.0-pre.120
1.0.0-pre.110
1.0.0-pre.100
1.0.0-pre.90
1.0.0-pre.80
1.0.0-pre.70
1.0.0-pre.60

Package Sidebar

Install

npm i @esfx/async-waitqueue

Weekly Downloads

448

Version

1.0.0

License

Apache-2.0

Unpacked Size

48.5 kB

Total Files

9

Last publish

Collaborators

  • rbuckton