https://github.com/karolsluszniak/side-effect-patterns
A showcase of different approaches towards flow control around synchronous side-effects.
https://github.com/karolsluszniak/side-effect-patterns
Last synced: 28 days ago
JSON representation
A showcase of different approaches towards flow control around synchronous side-effects.
- Host: GitHub
- URL: https://github.com/karolsluszniak/side-effect-patterns
- Owner: karolsluszniak
- Created: 2018-10-11T14:23:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T11:39:14.000Z (almost 7 years ago)
- Last Synced: 2025-07-14T03:01:16.765Z (3 months ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# side-effect-patterns
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 origin
- `pubsub` - interested parties aka. handlers subscribe to events emitted by origin
- `observer` - origin trigger signals that emit to observers they're aware ofHere's what you can find in this repo:
- `lib` - basic library implementations for `pubsub` and `observer` patterns
- `examples` - real-life cases for all presented approaches
- `basic` - plain implementation
- `create_invoice` - more complex case inspired by DDD## Usage
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.