-
Notifications
You must be signed in to change notification settings - Fork 24
Home
Alex Tan Hong Pin edited this page Apr 1, 2018
·
2 revisions
List of concurrency patterns and best practices:
- take
- generator
- shard/split
- worker
- backoff
- backpressure
- rate-limit
- throttle
- to-type
- repeat
- error
- or
- or-done
- future
- fan-in
- fan-out
- cancellation
- deadline
- retry
Based on the book, Designing Distributed System.
- Copier takes a single stream of work items and duplicate it out into two or more identical streams.
- Filter reduces the stream of work items to smaller stream of work items by filtering out work items that does not meet specific criteria.
- Splitter evaluates some criteria - just like filter - but instead of eliminating input, the splitter sends different inputs to different queues based on that criteria.
- Sharder divides up a single queue into an evenly divided collection of work items based upon some sharding function.
- Merger is the opposite of copier - it takes two different work queues and turn them into a single work queue.