Cameron Westland
2009-Jan-05 17:22 UTC
[Backgroundrb-devel] Problems Reading ask_result in controller
Hey Folks, I am running Rails 2.1.1 and am having problems getting a result from ask_result in my controller: MiddleMan.worker(:uploader_worker, ''abc123'').ask_result("percent_complete") is returning nil I am creating my worker like this: MiddleMan.new_worker(:worker => :uploader_worker, :worker_key => ''abc123'') worker = MiddleMan.worker(:uploader_worker, ''abc123'') worker.async_upload(:arg => files_to_upload) When I run the above command in script/console I get a return value MiddleMan.worker(:uploader_worker, ''abc123'').ask_result("percent_complete") -> 14 I am using periodically_call_remote to call my controller action. Oh and I''m using memcache to store the data in cache. Really lost here why the controller can''t access the data. Thanks! Cameron Big Bang Technology Inc. http://www.bigbangtechnology.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090105/d51ddf67/attachment.html>
hemant
2009-Jan-07 02:40 UTC
[Backgroundrb-devel] Problems Reading ask_result in controller
If worker results are coming from console, but not from controller, it might be because results hasn''t been cached yet? If you can post worker code, it might be useful to debug further. On Mon, Jan 5, 2009 at 10:52 PM, Cameron Westland <cameron at bigbangtechnology.com> wrote:> Hey Folks, > I am running Rails 2.1.1 and am having problems getting a result from > ask_result in my controller: > MiddleMan.worker(:uploader_worker, ''abc123'').ask_result("percent_complete") > is returning nil > I am creating my worker like this: > MiddleMan.new_worker(:worker => :uploader_worker, :worker_key => ''abc123'') > > worker = MiddleMan.worker(:uploader_worker, ''abc123'') > worker.async_upload(:arg => files_to_upload) > When I run the above command in script/console I get a return value > MiddleMan.worker(:uploader_worker, ''abc123'').ask_result("percent_complete") > -> 14 > > I am using periodically_call_remote to call my controller action. > Oh and I''m using memcache to store the data in cache. > Really lost here why the controller can''t access the data. > Thanks! > > > Cameron > Big Bang Technology Inc. > http://www.bigbangtechnology.com/ > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org