CMDx 2.0: faster, leaner service objects for Ruby
CMDx 2.0 is a full runtime rewrite focused on speed, ergonomics, and observability for service-object-style business logic.
Highlights:
Halts are ~2.5× faster, workflow failures ~3×, allocations down 50–80%.
- Faster runtime — frozen results, fiber-local chains, copy-on-write registries, and a slimmer hot path
-
Cleaner task API —
def work+Task.execute/execute!, declaredoutputs,around_execution, pattern matching onResult -
Saga-style workflows — automatic
rollbackacross groups, parallel execution with:threadsor:fibers, pluggable merge strategies -
Better failure handling —
Fault.for?/.reason?/.matches?matchers you canrescue, retries with built-in jitter strategies (:exponential,:fibonacci,:decorrelated_jitter) - First-class observability — telemetry pub/sub, correlation ids threaded through every task, structured logs out of the box
- Lighter footprint — stdlib only at runtime (no ActiveSupport), Ruby 3.3+
Manpages:
- Docs: https://drexed.github.io/cmdx/
- Repo: https://github.com/drexed/cmdx
- Migration guide: https://github.com/drexed/cmdx/blob/main/docs/v2-migration.md
Post a comment