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, #disconnect_for_fork
Instance Method Details
#acquire(_key, _ttl) ⇒ Boolean
Always returns true (lock always “acquired”).
125 126 127 |
# File 'lib/kaal/backend/adapter.rb', line 125 def acquire(_key, _ttl) # rubocop:disable Naming/PredicateMethod true end |
#release(_key) ⇒ Boolean
No-op implementation (nothing to release).
134 135 136 |
# File 'lib/kaal/backend/adapter.rb', line 134 def release(_key) # rubocop:disable Naming/PredicateMethod true end |
#with_lock(_key) { ... } ⇒ Object
Execute the block without any actual locking (always succeeds).
145 146 147 |
# File 'lib/kaal/backend/adapter.rb', line 145 def with_lock(_key, **) yield end |