search for: requestqueuepollerworker

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

2008 Mar 18
1
Polling is REALLY slow
...9;'s state is changed, and I only want to process once. Plus, I can schedule things better this way. My first thought was to create a worker that polled for records with the correct state, but it doesn''t 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(...