Class: Kaal::Backend::NullAdapter
- Defined in:
- lib/kaal/backend/adapter.rb
Overview
Null backend adapter that always succeeds (useful for development/testing).
This adapter provides a no-op implementation: it always returns true for acquire and does nothing on release. Use this when you want to run the scheduler without distributed coordination (e.g., single-node development).
Instance Method Summary collapse
-
#acquire(_key, _ttl) ⇒ Boolean
Always returns true (lock always “acquired”).
-
#release(_key) ⇒ Boolean
No-op implementation (nothing to release).
-
#with_lock(_key) { ... } ⇒ Object
Execute the block without any actual locking (always succeeds).
Methods inherited from Adapter
#definition_registry, #delayed_store
Instance Method Details
#acquire(_key, _ttl) ⇒ Boolean
Always returns true (lock always “acquired”).
121 122 123 |
# File 'lib/kaal/backend/adapter.rb', line 121 def acquire(_key, _ttl) # rubocop:disable Naming/PredicateMethod true end |
#release(_key) ⇒ Boolean
No-op implementation (nothing to release).
130 131 132 |
# File 'lib/kaal/backend/adapter.rb', line 130 def release(_key) # rubocop:disable Naming/PredicateMethod true end |
#with_lock(_key) { ... } ⇒ Object
Execute the block without any actual locking (always succeeds).
141 142 143 |
# File 'lib/kaal/backend/adapter.rb', line 141 def with_lock(_key, **) yield end |