Class: Dynflow::Coordinator::ExecutionLock
- Inherits:
 - 
      LockByWorld
      
        
- Object
 - Serializable
 - Record
 - Lock
 - LockByWorld
 - Dynflow::Coordinator::ExecutionLock
 
 
- Defined in:
 - lib/dynflow/coordinator.rb
 
Constant Summary
Constants inherited from Serializable
Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT
Instance Attribute Summary
Attributes inherited from Record
Class Method Summary collapse
Instance Method Summary collapse
- #client_world_id ⇒ Object
 - 
  
    
      #execution_plan_id  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
we need to store the following data in case of invalidation of the lock from outside (after the owner world terminated unexpectedly).
 - 
  
    
      #initialize(world, execution_plan_id, client_world_id, request_id)  ⇒ ExecutionLock 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of ExecutionLock.
 - #request_id ⇒ Object
 - #unlock_on_shutdown? ⇒ Boolean
 
Methods inherited from LockByWorld
inherited, unique_filter, valid_classes, valid_owner_ids, #validate!, #world_id
Methods inherited from Lock
constantize, #owner_id, #to_s, #validate!
Methods inherited from Record
#==, constantize, #from_hash, #hash, #id, new_from_hash, #to_hash, #to_s, #validate!
Methods inherited from Serializable
constantize, from_hash, new_from_hash, #to_hash
Constructor Details
#initialize(world, execution_plan_id, client_world_id, request_id) ⇒ ExecutionLock
Returns a new instance of ExecutionLock.
      283 284 285 286 287 288 289  | 
    
      # File 'lib/dynflow/coordinator.rb', line 283 def initialize(world, execution_plan_id, client_world_id, request_id) super(world) @data.merge!(id: self.class.lock_id(execution_plan_id), execution_plan_id: execution_plan_id, client_world_id: client_world_id, request_id: request_id) end  | 
  
Class Method Details
.lock_id(execution_plan_id) ⇒ Object
      291 292 293  | 
    
      # File 'lib/dynflow/coordinator.rb', line 291 def self.lock_id(execution_plan_id) "execution-plan:#{execution_plan_id}" end  | 
  
Instance Method Details
#client_world_id ⇒ Object
      302 303 304  | 
    
      # File 'lib/dynflow/coordinator.rb', line 302 def client_world_id @data[:client_world_id] end  | 
  
#execution_plan_id ⇒ Object
we need to store the following data in case of invalidation of the lock from outside (after the owner world terminated unexpectedly)
      298 299 300  | 
    
      # File 'lib/dynflow/coordinator.rb', line 298 def execution_plan_id @data[:execution_plan_id] end  | 
  
#request_id ⇒ Object
      306 307 308  | 
    
      # File 'lib/dynflow/coordinator.rb', line 306 def request_id @data[:request_id] end  | 
  
#unlock_on_shutdown? ⇒ Boolean
      310 311 312  | 
    
      # File 'lib/dynflow/coordinator.rb', line 310 def unlock_on_shutdown? false end  |