A showcase of different approaches towards flow control around synchronous side-effects, without and with the use of eventing.
call
- basic flow in which side-effects are directly triggered from originpubsub
- interested parties aka. handlers subscribe to events emitted by originobserver
- origin trigger signals that emit to observers they're aware of
Here's what you can find in this repo:
lib
- basic library implementations forpubsub
andobserver
patternsexamples
- real-life cases for all presented approachesbasic
- plain implementationcreate_invoice
- more complex case inspired by DDD
In order to run examples, run the following commands:
ruby examples/basic/run.rb
ruby examples/create_invoice/run.rb
In order to compare specific approaches, use your favorite diffing tool.