Make an Event of It
summary
Claims that evented patterns decouple concerns so controllers stop accumulating side effects and tests shrink to asserting a single event fire; demonstrates a tiny implementation (SimpleEvents::Notifier) — about fifty lines — and reuse of ActiveSupport::Notifications in Rails. Uses a New Relic example where a server-side config shifts the readiness point to a later event named configured, which simplifies unit tests but surfaces issues: a guard for >100 subscribers, potential ordering dependencies, synchronous execution, performance costs and memory-leak risks.
AI-written summary · about
chapters (13)
- 0:00Start
- 4:36The Pattern Coupling Mechanics Responsibilities
- 6:25Why Not Methods?
- 6:44Why Not Callbacks?
- 13:01Implicit Ordering
- 13:53Performance up
- 14:48Error collection
- 15:29No Setup Please!
- 17:01Compatibiltys Layer
- 24:57Naming
- 25:56Flexible Payload
- 26:41Primitives at Boundaries
- 29:17Nesting
related talks
23mSeparating Your Concerns With the Solidus Event System
35mDigging Deep with ActiveSupport::Notifications
39mExploring Rails anti-patterns
34mDon't Settle for Poor Names (or for Poor Design)
17mActiveSupport::Notifications and Live Status Pages
54mThinking in Events
34mSimple and Elegant Rails Code with Functional Style
27mScaling a Rails Monolith w/Event Driven Microservices
