Class: Chimp::ParallelExecutionGroup
- Inherits:
-
ExecutionGroup
- Object
- ExecutionGroup
- Chimp::ParallelExecutionGroup
- Defined in:
- lib/right_chimp/queue/execution_group.rb
Overview
ParallelExecutionGroup: run multiple jobs at once
Instance Attribute Summary
Attributes inherited from ExecutionGroup
#concurrency, #description, #group_id, #started, #time_end, #time_start
Instance Method Summary collapse
-
#initialize(new_group_id) ⇒ ParallelExecutionGroup
constructor
A new instance of ParallelExecutionGroup.
- #ready? ⇒ Boolean
- #short_name ⇒ Object
Methods inherited from ExecutionGroup
#cancel, #done?, #get_job, #get_job_ids, #get_jobs, #get_jobs_by_status, #get_total_exec_time, #job_completed, #push, #queue, #requeue, #requeue_failed_jobs!, #reset!, #results, #running?, #set_jobs, #shift, #size, #sort!, #to_s
Constructor Details
#initialize(new_group_id) ⇒ ParallelExecutionGroup
Returns a new instance of ParallelExecutionGroup.
292 293 294 295 |
# File 'lib/right_chimp/queue/execution_group.rb', line 292 def initialize(new_group_id) super(new_group_id) @concurrency = 25 end |
Instance Method Details
#ready? ⇒ Boolean
297 298 299 |
# File 'lib/right_chimp/queue/execution_group.rb', line 297 def ready? return (get_jobs_by_status(Executor::STATUS_NONE).size > 0) # and get_jobs_by_status(Executor::STATUS_RUNNING).size < @concurrency) end |
#short_name ⇒ Object
301 302 303 |
# File 'lib/right_chimp/queue/execution_group.rb', line 301 def short_name "P" end |