Class: Chimp::ParallelExecutionGroup

Inherits:
ExecutionGroup show all
Defined in:
lib/right_chimp/queue/ExecutionGroup.rb

Overview

ParallelExecutionGroup: run multiple jobs at once

Instance Attribute Summary

Attributes inherited from ExecutionGroup

#concurrency, #description, #group_id, #time_end, #time_start

Instance Method Summary collapse

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.



286
287
288
289
# File 'lib/right_chimp/queue/ExecutionGroup.rb', line 286

def initialize(new_group_id)
  super(new_group_id)
  @concurrency = 25
end

Instance Method Details

#ready?Boolean

FIXME - we’re not currently using the @concurrency setting to limit execution

due to an unknown bug...

Returns:

  • (Boolean)


295
296
297
# File 'lib/right_chimp/queue/ExecutionGroup.rb', line 295

def ready?
  return (get_jobs_by_status(Executor::STATUS_NONE).size > 0) # and get_jobs_by_status(Executor::STATUS_RUNNING).size < @concurrency)
end

#short_nameObject



299
300
301
# File 'lib/right_chimp/queue/ExecutionGroup.rb', line 299

def short_name
  "P"
end