Class: Dynflow::ThrottleLimiter
- Inherits:
-
Object
- Object
- Dynflow::ThrottleLimiter
- Defined in:
- lib/dynflow/throttle_limiter.rb
Defined Under Namespace
Classes: Core
Instance Attribute Summary collapse
-
#core ⇒ Object
readonly
Returns the value of attribute core.
Instance Method Summary collapse
- #cancel!(plan_id) ⇒ Object
- #core_class ⇒ Object
- #finish(plan_id) ⇒ Object
- #handle_plans!(*args) ⇒ Object
-
#initialize(world) ⇒ ThrottleLimiter
constructor
A new instance of ThrottleLimiter.
- #initialize_plan(plan_id, semaphores_hash) ⇒ Object
- #observe(parent_id = nil) ⇒ Object
- #terminate ⇒ Object
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
#core ⇒ Object (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_class ⇒ Object
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 |
#terminate ⇒ Object
28 29 30 |
# File 'lib/dynflow/throttle_limiter.rb', line 28 def terminate core.ask(:terminate!) end |