Displaying 3 results from an estimated 3 matches for "stop_polling".
2006 Aug 16
7
Forward of moderated message
OK I know whats happening. Your while loop completes and calls kill
on the worker before your task_progress controller method ever gets
called> So the worker is deleted and when you try to access it from
rails you get an error because there is no longer a worker at that
job key. The kill method is meant to be used within a worker that you
fire and forget. If you want to get the
2008 Mar 18
1
Polling is REALLY slow
...#39;, :lock => true)
request.search! unless request.nil? # make sure I don''t hit again
end
if request
self.build_matches(request.id)
sleep_time = 0
request = nil
end
sleep(sleep_time)
end
end
end
def stop_polling
@running = false
end
end
In my test case, there are 20 Request items. Normally, it would take about 5
seconds to call Request.build_matches on 20 Request items. However, asking
for work like so:
MiddleMan.ask_work(:worker => :request_queue_poller_worker, :worker_method
=> :build_all...
2006 Oct 04
0
do_work and long running rails tasks?
...ressbar'', progress_percent)
@rows = Sysloglog.find( worker.rows) rescue []
page.replace_html ''syslog_rows'', :partial => "analysis/
syslog", :object => @rows
if progress_percent >= 100
page.assign ''stop_polling'', true #<< here is the magick!
page.hide ''progress''
MiddleMan.delete_worker(session[:host_info])
end
end
else
render :update do |page|
end
end
else
redirect_to :action => &...