Class: Orchestrator::Core::ScheduleProxy
- Inherits:
-
Object
- Object
- Orchestrator::Core::ScheduleProxy
- Defined in:
- lib/orchestrator/core/schedule_proxy.rb
Instance Attribute Summary collapse
-
#schedules ⇒ Object
readonly
Returns the value of attribute schedules.
Instance Method Summary collapse
- #at(*args, &block) ⇒ Object
- #clear ⇒ Object
- #cron(*args, &block) ⇒ Object
- #every(*args, &block) ⇒ Object
- #in(*args, &block) ⇒ Object
-
#initialize(thread) ⇒ ScheduleProxy
constructor
A new instance of ScheduleProxy.
Constructor Details
#initialize(thread) ⇒ ScheduleProxy
Returns a new instance of ScheduleProxy.
7 8 9 10 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 7 def initialize(thread) @scheduler = thread.scheduler @schedules = Set.new end |
Instance Attribute Details
#schedules ⇒ Object (readonly)
Returns the value of attribute schedules.
12 13 14 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 12 def schedules @schedules end |
Instance Method Details
#at(*args, &block) ⇒ Object
22 23 24 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 22 def at(*args, &block) add_schedule @scheduler.at(*args, &block) end |
#clear ⇒ Object
30 31 32 33 34 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 30 def clear @schedules.each do |schedule| schedule.cancel end end |
#cron(*args, &block) ⇒ Object
26 27 28 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 26 def cron(*args, &block) add_schedule @scheduler.cron(*args, &block) end |
#every(*args, &block) ⇒ Object
14 15 16 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 14 def every(*args, &block) add_schedule @scheduler.every(*args, &block) end |
#in(*args, &block) ⇒ Object
18 19 20 |
# File 'lib/orchestrator/core/schedule_proxy.rb', line 18 def in(*args, &block) add_schedule @scheduler.in(*args, &block) end |