~/talk

Service Objects With Dry.rb: Monads and Transactions

Talkat RubyConf 2021 · 2021-11-08..11-10· [ruby]
slides:none on file

Claims that Dry::Transaction turns chains of service objects into explicit sequential steps with success/failure monads, using dry-monads and dry-validation, and that TextUs runs this style in production for three years. Shows an authenticate flow implemented with adapters like merge step, try, map, check and t, transactions halting on failure, a matcher DSL that forces exhaustive failure handling, runtime step injection for deterministic tests, and async/maybe adapters for background and optional sub-transactions.

AI-written summary · about

  1. 0:00Start
  2. 1:03The Problem
  3. 1:55Service Objects
  4. 3:19Command Pattern
  5. 9:37Anatomy of a Transaction
  6. 11:02Maybe Monad
  7. 22:29Error handling-Matcher DSL
  8. 24:59Testing - Step Injection
  9. 26:41Custom Step Adapters
  10. 26:53Custom Step Adapter - Merge
  11. 28:29Custom Step Adapter - Validate
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.