Class: Dynflow::ThrottleLimiter

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

Defined Under Namespace

Classes: Core

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(world) ⇒ ThrottleLimiter

Returns a new instance of ThrottleLimiter.



7
8
9
10
# File 'lib/dynflow/throttle_limiter.rb', line 7

def initialize(world)
  @world = world
  spawn
end

Instance Attribute Details

#coreObject (readonly)

Returns the value of attribute core.



5
6
7
# File 'lib/dynflow/throttle_limiter.rb', line 5

def core
  @core
end

Instance Method Details

#cancel!(plan_id) ⇒ Object



24
25
26
# File 'lib/dynflow/throttle_limiter.rb', line 24

def cancel!(plan_id)
  core.tell([:cancel, plan_id])
end

#core_classObject



36
37
38
# File 'lib/dynflow/throttle_limiter.rb', line 36

def core_class
  Core
end

#finish(plan_id) ⇒ Object



16
17
18
# File 'lib/dynflow/throttle_limiter.rb', line 16

def finish(plan_id)
  core.tell([:finish, plan_id])
end

#handle_plans!(*args) ⇒ Object



20
21
22
# File 'lib/dynflow/throttle_limiter.rb', line 20

def handle_plans!(*args)
  core.ask!([:handle_plans, *args])
end

#initialize_plan(plan_id, semaphores_hash) ⇒ Object



12
13
14
# 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) ⇒ Object



32
33
34
# File 'lib/dynflow/throttle_limiter.rb', line 32

def observe(parent_id = nil)
  core.ask!([:observe, parent_id])
end

#terminateObject



28
29
30
# File 'lib/dynflow/throttle_limiter.rb', line 28

def terminate
  core.ask(:terminate!)
end