dry-rb / dry-effects

Algebraic effects in Ruby
https://dry-rb.org/gems/dry-effects/
MIT License
112 stars 20 forks source link

Injectable lock backend #50

Closed flash-gordon closed 5 years ago

flash-gordon commented 5 years ago

The typical use case for that is

include Dry::Effects::Handler.Lock
include Import['redis_lock_backend']

def call(...)
  with_lock(redis_lock_backend) do
    ...
  end
end