Displaying 1 result from an estimated 1 matches for "build_all_matches".
2008 Mar 18
1
Polling is REALLY slow
...work as expected. Here is what I have with error
checking, etc. removed:
class RequestQueuePollerWorker < BackgrounDRb::MetaWorker
set_worker_name :request_queue_poller_worker
QUEUE_SLEEP_TIME = 30 # seconds
def create(args = nil)
@running = true
self.poll_queue
end
def build_all_matches(args = nil)
thread_pool.defer(args) do |args|
requests = Request.find_active(:all)
requests.each { |request| request.queue! } # using
acts_as_state_machine
end
end
protected
# Was hoping to get multiple threads processing
def build_matches(args = nil)
thread_poo...