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

1.0.0 • Public • Published

@esfx/async-manualresetevent

The @esfx/async-manualresetevent package provides the AsyncManualResetEvent class, an async coordination primitive.

Overview

Installation

npm i @esfx/async-manualresetevent

Usage

import { AsyncManualResetEvent } from "@esfx/async-manualresetevent";

const event = new AsyncManualResetEvent();

async function doSomeActivity() {
    // do some work asynchronously...

    // signal completion of the activity
    event.set();
}

async function doSomeOtherActivity() {
    // do some work asynchronously...

    // wait for 'doSomeActivity' to finish
    await event.wait();

    // keep working now that both activities have synchronized...
}

// start some work
doSomeActivity();

// start some other work
doSomeOtherActivity();

API

You can read more about the API here.

Readme

Keywords

none

Package Sidebar

Install

npm i @esfx/async-manualresetevent

Weekly Downloads

422

Version

1.0.0

License

Apache-2.0

Unpacked Size

35.4 kB

Total Files

9

Last publish

Collaborators

  • rbuckton