Reactor Under the Hood: Building a Graph-Based Saga Orchestrator in Elixir
summary
Reactor implements a dead simple graph algorithm (find nodes with no dependencies, run them, remove them, repeat) as a saga orchestrator in Elixir, using OTP for concurrency and timeouts. It enforces concurrency by a shared concurrency pool (default = online schedulers), limits undo retries to five, and composes nested workflows that share one counter. Two concrete fixes land in the executive: an escape hatch to avoid a compose deadlock (example: six-slot pool deadlocks) and a backoff stage that adds a spin outcome, growing the loop from 8 to 10 stages and outcomes from 4 to 5.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:04What is Reactor
- 3:09Graph-based workflow model
- 7:01Concurrency challenges
- 10:37Deadlock in pools
- 13:32Scheduling loop structure
- 15:40Retry backoff flaw
- 18:28Escape hatches and fixes
- 19:11Favorite design
- 19:54Resources and involvement
- 20:42Q&A
related talks
34mProcesses, StateCharts and WorkFlows
34mReactive Workflows a Year Later
21mLet's Sync the Async- A Primer on Redux Sagas
21mBetter Async with Redux Saga
29mStructure Your App's Story With Sagas and Selectors
54mThe Saga of yield: Hidden Capabilities
51mBe proactive about state in a reactive system
29mDesign decisions in React-based ClojureScript applications
