Skip to content

How does Observer("nestjs/event-emitter") differs from CQRS EventBus (nestjs/cqrs) ? #140

Answered by Sairyss
AlexSun98 asked this question in Q&A
Discussion options

You must be logged in to vote

Event emitter from nestjs/cqrs as far as I remember does not let you await for all events to finish, it's fire and forget. It means that if something crashes in the middle, event will be lost.
nestjs/event-emitter allows you to await for all events to execute, so we can save everything as a part of a transaction. This way no event is lost, if something fails in the middle entire transaction will be aborted (all or nothing).

For that reason event emitter from nestjs/cqrs is not used and I don't recommend using it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AlexSun98
Comment options

Answer selected by AlexSun98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants