- Cancellation [Sample, API Reference]
- Coordination [Sample, API Reference]
- Scheduling [Sample, API Reference]
For the latest version:
npm install prex
- API Reference
API Reference: Cancellation
The CancellationTokenSource and CancellationToken primitives allow you to create asynchronous operations that can be canceled externally. The following is an example of a function used to download a file asynchronously that can be canceled:
API Reference: Coordination
A Semaphore can be used to protect access to a critical section of your code when you must limit access across multiple async operations. The following is an example of two functions which both need exclusive access to a single resource but could possibly be preempted when suspended while awaiting an asynchronous operation:
A Barrier can be used to coordinate complex async operations:
API Reference: Scheduling
An AsyncQueue is a useful primitive for scheduling asynchronous work:
Copyright (c) Microsoft Corporation.
Licensed under the Apache License, Version 2.0.
See LICENSE file in the project root for details.