class Dynflow::ThrottleLimiter

Attributes

core[R]

Public Class Methods

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

Public Instance Methods

cancel!(plan_id) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 15
def cancel!(plan_id)
  core.tell([:cancel, plan_id])
end
core_class() click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 27
def core_class
  Core
end
handle_plans!(*args) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 11
def handle_plans!(*args)
  core.ask!([:handle_plans, *args])
end
observe(parent_id = nil) click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 23
def observe(parent_id = nil)
  core.ask!([:observe, parent_id])
end
terminate() click to toggle source
# File lib/dynflow/throttle_limiter.rb, line 19
def terminate
  core.ask(:terminate!)
end

Private Instance Methods

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