Class: Undertow::Store::Base
- Inherits:
-
Object
- Object
- Undertow::Store::Base
- Defined in:
- lib/undertow/store/base.rb
Overview
Abstract base class for Undertow store adapters.
Concrete adapters must implement all methods defined here. Buffer delegates all operations to the configured store, so adapters are the only place that knows about the underlying backend.
Direct Known Subclasses
Instance Method Summary collapse
-
#add_members(key, members) ⇒ Object
Add members to the set at key.
-
#lock_acquire(key, ttl:) ⇒ Object
Attempt to acquire a lock at key with the given TTL in seconds.
-
#lock_release(key) ⇒ Object
Release the lock at key.
-
#member_count(key) ⇒ Object
Return the number of members in the set at key.
-
#members(key) ⇒ Object
Return all members of the set at key.
-
#pop_members(key, count) ⇒ Object
Atomically remove and return up to count members from the set at key.
-
#remove_member(key, member) ⇒ Object
Remove a single member from the set at key.
Instance Method Details
#add_members(key, members) ⇒ Object
Add members to the set at key.
12 13 14 |
# File 'lib/undertow/store/base.rb', line 12 def add_members(key, members) raise NotImplementedError, "#{self.class}#add_members is not implemented" end |
#lock_acquire(key, ttl:) ⇒ Object
Attempt to acquire a lock at key with the given TTL in seconds. Returns true if the lock was acquired, false if already held.
38 39 40 |
# File 'lib/undertow/store/base.rb', line 38 def lock_acquire(key, ttl:) raise NotImplementedError, "#{self.class}#lock_acquire is not implemented" end |
#lock_release(key) ⇒ Object
Release the lock at key.
43 44 45 |
# File 'lib/undertow/store/base.rb', line 43 def lock_release(key) raise NotImplementedError, "#{self.class}#lock_release is not implemented" end |
#member_count(key) ⇒ Object
Return the number of members in the set at key.
32 33 34 |
# File 'lib/undertow/store/base.rb', line 32 def member_count(key) raise NotImplementedError, "#{self.class}#member_count is not implemented" end |
#members(key) ⇒ Object
Return all members of the set at key.
22 23 24 |
# File 'lib/undertow/store/base.rb', line 22 def members(key) raise NotImplementedError, "#{self.class}#members is not implemented" end |
#pop_members(key, count) ⇒ Object
Atomically remove and return up to count members from the set at key.
27 28 29 |
# File 'lib/undertow/store/base.rb', line 27 def pop_members(key, count) raise NotImplementedError, "#{self.class}#pop_members is not implemented" end |
#remove_member(key, member) ⇒ Object
Remove a single member from the set at key.
17 18 19 |
# File 'lib/undertow/store/base.rb', line 17 def remove_member(key, member) raise NotImplementedError, "#{self.class}#remove_member is not implemented" end |