Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruslanguns/eventemitter2-sync-vs-async
https://github.com/ruslanguns/eventemitter2-sync-vs-async
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ruslanguns/eventemitter2-sync-vs-async
- Owner: ruslanguns
- Created: 2022-05-04T09:30:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:33:23.000Z (11 months ago)
- Last Synced: 2024-05-28T17:06:55.264Z (6 months ago)
- Language: TypeScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TEST EventEmitter package and comparing async vs sync processes.
On sync process we need to use emitAsync and the result will be:
On async process we want to process request asynchronously to process multiple events and we should use just emit, and the result will be:
So, we noticed that when we process the calls using `emitAsync` the processes are being processed and the next emit will be emitted once the first one has been finished in the same queue, but this does not mean that they will processed like in a queue, if we emit multiple emitAsync they will be running in multiple threads, so keep in mind the rate limit, so in this case is better to consider a queue system like Bull with Redis or Mqtt.
## Description
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
## Installation
```bash
$ npm install
```## Running the app
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```## Test
```bash
# unit tests
$ npm run test# e2e tests
$ npm run test:e2e# test coverage
$ npm run test:cov
```## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## Stay in touch
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)## License
Nest is [MIT licensed](LICENSE).