class Dynflow::ThrottleLimiter

Attributes

core[R]

Public Class Methods

new(world) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 7
def initialize(world)
  @world = world
  spawn
end

Public Instance Methods

cancel!(plan_id) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 24
def cancel!(plan_id)
  core.tell([:cancel, plan_id])
end
core_class() click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 36
def core_class
  Core
end
finish(plan_id) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 16
def finish(plan_id)
  core.tell([:finish, plan_id])
end
handle_plans!(*args) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 20
def handle_plans!(*args)
  core.ask!([:handle_plans, *args])
end
initialize_plan(plan_id, semaphores_hash) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 12
def initialize_plan(plan_id, semaphores_hash)
  core.tell([:initialize_plan, plan_id, semaphores_hash])
end
observe(parent_id = nil) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 32
def observe(parent_id = nil)
  core.ask!([:observe, parent_id])
end
terminate() click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 28
def terminate
  core.ask(:terminate!)
end

Private Instance Methods

spawn() click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 42
def spawn
  Concurrent::Promises.resolvable_future.tap do |initialized|
    @core = core_class.spawn(:name => 'throttle-limiter',
                             :args => [@world],
                             :initialized => initialized)
  end
end