Displaying 1 result from an estimated 1 matches for "do_task".
Did you mean:
do_mask
2007 Dec 19
6
thread_pooling sleeping
...worker => :foo_worker)[current_user.id]
end
My worker is something like:
class FooWorker < BackgrounDRb::MetaWorker
set_worker_name :foo_worker
def create(args=nil)
@mutex = Mutex.new
@mutex.synchronize do
@statuses = {}
register_status(@statuses)
end
end
def do_task(some_user_id)
thread_pool.defer(some_user_id) do |user_id|
user = User.find user_id
save_status user_id, :progress, "Starting Task"
user.do_some_database_stuff
save_status user_id, :progress, "Task Stage 2"
user.do_some_other_database_stuff...