Class: ActiveJob::Locking::Adapters::Base
- Inherits:
-
Object
- Object
- ActiveJob::Locking::Adapters::Base
- Defined in:
- lib/activejob/locking/adapters/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#lock_manager ⇒ Object
readonly
Returns the value of attribute lock_manager.
-
#lock_token ⇒ Object
Returns the value of attribute lock_token.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #create_lock_manager ⇒ Object
-
#initialize(key, options) ⇒ Base
constructor
A new instance of Base.
- #lock ⇒ Object
- #refresh_lock!(refresh) ⇒ Object
- #unlock ⇒ Object
Constructor Details
#initialize(key, options) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 |
# File 'lib/activejob/locking/adapters/base.rb', line 8 def initialize(key, ) @key = key @options = @lock_manager = self.create_lock_manager end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/activejob/locking/adapters/base.rb', line 5 def key @key end |
#lock_manager ⇒ Object (readonly)
Returns the value of attribute lock_manager.
5 6 7 |
# File 'lib/activejob/locking/adapters/base.rb', line 5 def lock_manager @lock_manager end |
#lock_token ⇒ Object
Returns the value of attribute lock_token.
6 7 8 |
# File 'lib/activejob/locking/adapters/base.rb', line 6 def lock_token @lock_token end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/activejob/locking/adapters/base.rb', line 5 def @options end |
Instance Method Details
#create_lock_manager ⇒ Object
14 15 16 |
# File 'lib/activejob/locking/adapters/base.rb', line 14 def create_lock_manager raise('Subclass must implement') end |
#lock ⇒ Object
18 19 20 |
# File 'lib/activejob/locking/adapters/base.rb', line 18 def lock raise('Subclass must implement') end |
#refresh_lock!(refresh) ⇒ Object
26 27 28 |
# File 'lib/activejob/locking/adapters/base.rb', line 26 def refresh_lock!(refresh) raise('Subclass must implement') end |
#unlock ⇒ Object
22 23 24 |
# File 'lib/activejob/locking/adapters/base.rb', line 22 def unlock raise('Subclass must implement') end |