https://github.com/mishieck/parawait
A JavaScript library for concurrency and parallelism.
https://github.com/mishieck/parawait
async async-await await concurrency javascript library parallel-processing parallelism promises
Last synced: about 1 month ago
JSON representation
A JavaScript library for concurrency and parallelism.
- Host: GitHub
- URL: https://github.com/mishieck/parawait
- Owner: Mishieck
- License: mit
- Created: 2021-04-16T11:38:43.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T12:43:16.000Z (almost 4 years ago)
- Last Synced: 2024-04-25T20:03:46.424Z (about 1 year ago)
- Topics: async, async-await, await, concurrency, javascript, library, parallel-processing, parallelism, promises
- Language: TypeScript
- Homepage:
- Size: 441 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Parawait
## Introduction
Parawait is a JavaScript library for achieving concurrency and parallelism using promises. On single-core processors, the processes are run concurrently. On multi-core processors, the processes are run in parallel.
## Features
JavaScript provides native ways of running multiple processes at once. These include `Promise.all`, `Promise.race`, `Promise.any` and `Promise.allSettled`. The similarity between Parawait and the aforementioned methods is that they all use promises. However, there are a few significant differences between these methods and Parawait in terms of how they differ in terms of how they run the processes. Let us look at the features of Parawait.
### Memory Efficiency
All of the JavaScript native methods take an array of promises as the parameter. However, Parawait does not use an array of promises. This makes it more memory efficient.
### Synchronous Functions
The functions you want to run at once do not have to be asynchronous. Parawait wraps all functions in promises on your behalf.
### Error Handling
Parawait gives you the choice to choose how errors should be handled. You can choose whether or not the promise should be rejected. You can also choose whether or not the promised should resolve with an output.
### Chunking
Running so many processes at once uses a lot of memory. This might also stand in the way of other processes. Sometimes, this results into errors as there is a limit to the call stack. Parawait allows you to run processes in chunks.
## Quick Start
Refer to our [Quick Start Guide](./docs/quick-start.md) for a quick introduction to how Parawait works.
## Documentation
Refer to our [Documentation](./docs/home.md) for an in-depth look at Parawait.
## License
This library is under the [MIT Licence](https://).
Copyright (c) 2021, **Mishieck Mwale**.