search for: backgroundrbduplicatekeyerror

Displaying 1 result from an estimated 1 matches for "backgroundrbduplicatekeyerror".

2006 Jun 28
1
How to add some process control...
...grounDRb::Rails.initialize() def new_worker(opts={}) @mutex.synchronize { job_key = opts[:job_key] || gen_key unless self[job_key] self[job_key] = instantiate_worker(opts[:class]).new(job_key,opts[:args]) self[job_key].start_process return job_key else raise ::BackgrounDRbDuplicateKeyError end } end In MiddleMan::delete_worker(), I''ve added steps where, if the job is still alive, activate the kill signal to the job, and wait for it to clean itself up and activate the :safe_to_kill signal. Then kill it. def delete_worker(key) @mutex.synchronize { if @jobs[key]...