Rack Middleware as a General Purpose Abstraction
summary
Argues that Rack-style middleware is a general abstraction that replaces sprawling classes and fragile mixins, demonstrated by Vagrant where commands compose as a Builder of 22 middleware components passing a shared state bag; each middleware has an initialize and call, is trivial to unit test, and shows clear ordering and reuse (suspend reuses top middlewares from up). Also describes an inserted Warden error recovery layer that handles exceptions and signals so middleware unwinds cleanly — used in production Vagrant and reduces complexity while remaining performant enough.
AI-written summary · about
chapters (16)
- 0:00Start
- 2:16Problems
- 2:48Unclear dependencies
- 3:17Difficult to Test
- 3:56Mixin all the things!
- 9:53Function Composition Applied to Large Classes?
- 10:38Python Web Server Gateway Interface v1.0
- 10:55Request Processing
- 13:38Explicit Ordering
- 14:03Visible Dependencies
- 14:57Easily Tested
- 15:55Extensible: Subclass!
- 16:12Virtual Machine Lifecycle
- 19:46Scared?
- 24:14Reuse
- 24:55Serial Invocations
related talks
22mRack Middleware as a General Purpose Abstraction
28mIn a World of Middleware, Who Needs Monolithic Applications
30mThe Power of Middleware - Building Your Own Mini Web Framework on Rack
27mHarness the power of functions to build composable rack applications
28mRack for web developers
41mRack - A Framework to Roll Your Own
34mMiles more maintainable: building APIs with the middleware pattern
38mRewriting Rack: A Functional Approach
