class Dynflow::DelayedExecutors::Abstract

Attributes

core[R]

Public Class Methods

new(world, options = {}) click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 8
def initialize(world, options = {})
  @world = world
  @options = options
  @started = false
  spawn
end

Public Instance Methods

spawn() click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 29
def spawn
  Concurrent::Promises.resolvable_future.tap do |initialized|
    @core = core_class.spawn name: 'delayed-executor',
                             args: [@world, @options],
                             initialized: initialized
  end
end
start() click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 19
def start
  @core.ask(:start).tap do
    @started = true
  end
end
started?() click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 15
def started?
  @started
end
terminate() click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 25
def terminate
  @core.ask(:terminate!)
end

Private Instance Methods

core_class() click to toggle source
# File lib/dynflow/delayed_executors/abstract.rb, line 39
def core_class
  raise NotImplementedError
end