Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tarquas/asclasit
ASync CLasses + ASync ITerators
https://github.com/tarquas/asclasit
async class framework generator helpers iterator streaming-algorithms
Last synced: about 2 months ago
JSON representation
ASync CLasses + ASync ITerators
- Host: GitHub
- URL: https://github.com/tarquas/asclasit
- Owner: tarquas
- License: mit
- Created: 2021-03-30T21:24:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-21T06:53:20.000Z (almost 3 years ago)
- Last Synced: 2024-11-10T04:51:48.092Z (2 months ago)
- Topics: async, class, framework, generator, helpers, iterator, streaming-algorithms
- Language: JavaScript
- Homepage:
- Size: 728 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asclasit
ASync CLasses + ASync ITerators# Description
This is public-ready spin off from related internal experiments of [ClAsync](https://github.com/tarquas/clasync).
Advantages of this module:
- 100% test coverage;
- More project files, less file sizes;
- Thin: has no external dependency modules, only core essentials taken from `ClAsync` and improved;
- Utilizes up-to-date Node.js features;
- Targetting serverless/stateless environments;
- Despite the missing documentation, test cases describe the usage.## Differences
There are architectural differences listed below:### Async Classes
| Item | `ClAsync` | `AsClAsIt` |
|-------------|------------|-------------|
| Instance co-op | Dependency tree | State isolation |
| Life cycle | Once (`init`->`final`) | Muplitle (...->`wake`->`sleep`->...) |
| Lifetime Methods | `init()`, `final()` | (Async) Generator `*[$]()` depicting whole lifetime |
| Instance state | Non-configurable `[$.inst]` | Configurable `[$]` via `static [$]`: options object or custom `$.Inst` subclass |
| Async Events | Special class (`emitter.js`) | Automatic for each instance; methods of instance state `[$]` |
| Instance Shutdown | Supported (via `final`) | Not supported (global shutdown handler only for non-stateless environments) |### (Async) Iterators
| Item | `ClAsync` | `AsClAsIt` |
|-------------|------------|-------------|
| Helpers | Functions: `$.[Iter\|Async](it, ...)` | Wrapped chain: `$[.Iter\|.AsIt\|](it).(...).(...)` |
| Extensible Classes | Not supported | Supported for sync (`$.Iter`) and async (`$.AsIt`) iterator classes |## Testing
Tests and coverage powered by [Jest](https://jestjs.io/)# Thanks
[Time Doctor](https://timedoctor.com/)