[Backgroundrb-devel] ask_result usage
funnie_16 at hotmail.com
Wed Sep 17 18:05:04 EDT 2008
Try usingkey = MiddleMan.new_worker(:worker => :transfer_worker, :worker_key => random_key)sleep 0.3 #hack if you're running OS XMiddleMan.worker(:transfer_worker, key).method(:arg => args)Then use MiddleMan.worker(:transfer_worker, key).ask_result> From: mark at sabado.com> To: backgroundrb-devel at rubyforge.org> Date: Wed, 17 Sep 2008 15:04:57 -0400> Subject: [Backgroundrb-devel] ask_result usage> > > I am new to Backgroundrb and am struggling to get a progress bar > working on a long running job. I have it setup with memcache which is > working. The code works when I check status using> > MiddleMan.worker(:transfer_worker).ask_result(:percent_complete)> > However, things get messed up when I run a second instance of this > task and percent_complete is still 100% from the last run.> > So, I assume I need the ask_result version that uses the job_key so > that I am looking at a separate instance from the cache. I tried> > result = MiddleMan.ask_result(:worker > => :transfer_worker, :job_key => job_key)> result[:percent_complete]> > which is similar to how ask_status was used in the Advanced Rails > Recipes book, but this gives> > undefined method `ask_result' for #<BackgrounDRb::ClusterConnection: > 0x1f496a0>> > Any hints as to what I am screwing up? Thanks!> > > Mark Lynn> Sabado Technologies> mark at sabado.com> > > > > _______________________________________________> Backgroundrb-devel mailing list> Backgroundrb-devel at rubyforge.org> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
Start het nieuwe schooljaar sterk en voordelig!
More information about the Backgroundrb-devel