Class: Dynflow::Testing::DummyWorld
- Inherits:
 - 
      Object
      
        
- Object
 - Dynflow::Testing::DummyWorld
 
 
- Extended by:
 - Mimic
 
- Defined in:
 - lib/dynflow/testing/dummy_world.rb
 
Instance Attribute Summary collapse
- 
  
    
      #action  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute action.
 - 
  
    
      #clock  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute clock.
 - 
  
    
      #coordinator  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute coordinator.
 - 
  
    
      #delayed_executor  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute delayed_executor.
 - 
  
    
      #executor  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute executor.
 - 
  
    
      #middleware  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute middleware.
 
Instance Method Summary collapse
- #action_logger ⇒ Object
 - #event(execution_plan_id, step_id, event, future = Concurrent::Promises.resolvable_future) ⇒ Object
 - 
  
    
      #initialize(_config = nil)  ⇒ DummyWorld 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of DummyWorld.
 - #logger ⇒ Object
 - #persistence ⇒ Object
 - #plan_event(execution_plan_id, step_id, event, time, accepted = Concurrent::Promises.resolvable_future) ⇒ Object
 - #silence_logger! ⇒ Object
 - #subscribed_actions(klass) ⇒ Object
 
Methods included from Mimic
Constructor Details
#initialize(_config = nil) ⇒ DummyWorld
Returns a new instance of DummyWorld.
      12 13 14 15 16 17 18  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 12 def initialize(_config = nil) @logger_adapter = Testing.logger_adapter @clock = ManagedClock.new @executor = DummyExecutor.new(self) @middleware = Middleware::World.new @coordinator = DummyCoordinator.new end  | 
  
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
      10 11 12  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 10 def action @action end  | 
  
#clock ⇒ Object (readonly)
Returns the value of attribute clock.
      9 10 11  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 9 def clock @clock end  | 
  
#coordinator ⇒ Object (readonly)
Returns the value of attribute coordinator.
      9 10 11  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 9 def coordinator @coordinator end  | 
  
#delayed_executor ⇒ Object (readonly)
Returns the value of attribute delayed_executor.
      9 10 11  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 9 def delayed_executor @delayed_executor end  | 
  
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
      9 10 11  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 9 def executor @executor end  | 
  
#middleware ⇒ Object (readonly)
Returns the value of attribute middleware.
      9 10 11  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 9 def middleware @middleware end  | 
  
Instance Method Details
#action_logger ⇒ Object
      20 21 22  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 20 def action_logger @logger_adapter.action_logger end  | 
  
#event(execution_plan_id, step_id, event, future = Concurrent::Promises.resolvable_future) ⇒ Object
      36 37 38  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 36 def event(execution_plan_id, step_id, event, future = Concurrent::Promises.resolvable_future) executor.event execution_plan_id, step_id, event, future end  | 
  
#logger ⇒ Object
      24 25 26  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 24 def logger @logger_adapter.dynflow_logger end  | 
  
#persistence ⇒ Object
      48 49 50  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 48 def persistence nil end  | 
  
#plan_event(execution_plan_id, step_id, event, time, accepted = Concurrent::Promises.resolvable_future) ⇒ Object
      40 41 42 43 44 45 46  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 40 def plan_event(execution_plan_id, step_id, event, time, accepted = Concurrent::Promises.resolvable_future) if time.nil? || time < Time.now event(execution_plan_id, step_id, event, accepted) else clock.ping(executor, time, Director::Event[SecureRandom.uuid, execution_plan_id, step_id, event, accepted], :delayed_event) end end  | 
  
#silence_logger! ⇒ Object
      28 29 30  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 28 def silence_logger! action_logger.level = 4 end  | 
  
#subscribed_actions(klass) ⇒ Object
      32 33 34  | 
    
      # File 'lib/dynflow/testing/dummy_world.rb', line 32 def subscribed_actions(klass) [] end  |