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