Class: Maxwell::Agent::WorkSchedule
- Inherits:
-
Object
- Object
- Maxwell::Agent::WorkSchedule
- Includes:
- Celluloid
- Defined in:
- lib/maxwell/agent/work_schedule.rb
Instance Method Summary collapse
- #add(work) ⇒ Object
- #all ⇒ Object
- #count ⇒ Object
- #get ⇒ Object
- #put_back(work) ⇒ Object
- #schedule ⇒ Object
- #working ⇒ Object
Instance Method Details
#add(work) ⇒ Object
6 7 8 9 |
# File 'lib/maxwell/agent/work_schedule.rb', line 6 def add(work) async.add_work(work) work end |
#all ⇒ Object
40 41 42 |
# File 'lib/maxwell/agent/work_schedule.rb', line 40 def all schedule.concat(working) end |
#count ⇒ Object
11 12 13 14 15 |
# File 'lib/maxwell/agent/work_schedule.rb', line 11 def count redis do |redis| redis.zcard 'work_schedule' end end |
#get ⇒ Object
17 18 19 |
# File 'lib/maxwell/agent/work_schedule.rb', line 17 def get find_ready_for_work end |
#put_back(work) ⇒ Object
21 22 23 24 |
# File 'lib/maxwell/agent/work_schedule.rb', line 21 def put_back(work) remove_from_working_queue(work) async.add(work) end |