Class: Stoplight::Infrastructure::Storage::CompatibilityRecoveryLock

Inherits:
Object
  • Object
show all
Defined in:
lib/stoplight/infrastructure/storage/compatibility_recovery_lock.rb

Overview

Temporary adapter that bridges Domain::Storage::RecoveryLock to existing DataStore.

This compatibility layer allows the recovery lock abstraction to be introduced without breaking existing data store implementations. It delegates all lock operations to the data store’s original methods.

This adapter will be removed in a future versions once all data stores have native recovery lock implementations.

See Also:

  • Domain::_RecoveryLockStore

Instance Method Summary collapse

Constructor Details

#initialize(data_store:, config:) ⇒ CompatibilityRecoveryLock

Returns a new instance of CompatibilityRecoveryLock.



17
18
19
20
# File 'lib/stoplight/infrastructure/storage/compatibility_recovery_lock.rb', line 17

def initialize(data_store:, config:)
  @data_store = data_store
  @config = config
end

Instance Method Details

#acquire_lockObject

: Domain::Storage::RecoveryLockToken?



22
# File 'lib/stoplight/infrastructure/storage/compatibility_recovery_lock.rb', line 22

def acquire_lock = data_store.acquire_recovery_lock(config) #: Domain::Storage::RecoveryLockToken?

#release_lock(lock) ⇒ Object



24
# File 'lib/stoplight/infrastructure/storage/compatibility_recovery_lock.rb', line 24

def release_lock(lock) = data_store.release_recovery_lock(lock)