Class: Dynflow::SimpleWorld

Inherits:
World
  • Object
show all
Defined in:
lib/dynflow/simple_world.rb

Instance Attribute Summary

Attributes inherited from World

#action_classes, #auto_rescue, #executor, #logger_adapter, #middleware, #options, #persistence, #subscription_index, #transaction_adapter

Instance Method Summary collapse

Methods inherited from World

#action_logger, #clock, #consistency_check, #event, #execute, #execute_planned_execution_plans, #logger, #plan, #reload!, #subscribed_actions, #terminate, #trigger

Constructor Details

#initialize(options_hash = {}) ⇒ SimpleWorld

Returns a new instance of SimpleWorld.



3
4
5
6
7
8
9
10
# File 'lib/dynflow/simple_world.rb', line 3

def initialize(options_hash = {})
  super options_hash
  at_exit { self.terminate.wait } if options[:auto_terminate]
  # we can check consistency here because SimpleWorld doesn't expect
  # remote executor being in place.
  self.consistency_check
  self.execute_planned_execution_plans
end

Instance Method Details

#default_optionsObject



12
13
14
15
16
17
# File 'lib/dynflow/simple_world.rb', line 12

def default_options
  super.merge(pool_size:           5,
              persistence_adapter: PersistenceAdapters::Sequel.new('sqlite:/'),
              transaction_adapter: TransactionAdapters::None.new,
              auto_terminate:      true)
end