[Backgroundrb-devel] Results from worker are not available until after worker is completed

Jonathan Donaldson jonathan at column3.net
Wed Jan 7 11:07:38 EST 2009

I am using memcache, with my backgroundrb.yml set like:

   :port: 11006
   :result_storage: memcache

:memcache: ""

Is there something I need to do in the worker to get it to use it? I  
see the same behavior with both...

On Jan 7, 2009, at 11:02 AM, hemant wrote:

> On Wed, Jan 7, 2009 at 9:15 PM, Jonathan Donaldson <jonathan at column3.net 
> > wrote:
>> Sorry if this hit twice, my mailer was using the .com version of my  
>> email
>> address not the .net one I signed up with:
>> Using Backgroundrb pulled from github yesterday, and rails 2.2.2.
>> In my worker, I send lots of progress back as I step through the  
>> tasks, ie:
>> @items.each do |itm|
>> ...stuff happens here
>> @results[:created_items] += 1
>> cache[some_key] = @results
>> end
>> in next loop:
>> @ results[:errors] = "Error on Item 4",
>> cache[some_key] = @results
>> when I call ask_result on the worker, I get nil back until after  
>> the worker
>> is completely done, then I get my results....
>> ideas? This is to drive a progress bar and other 'realtime'  
>> feedback...
> You will have to use Memcache based backend of result storage for
> "realtime" feedback. Inbuilt cache behavior is like what you
> mentioned.
> For more info:
> http://backgroundrb.rubyforge.org/workers/#result_caching


Jonathan Donaldson
Partner, Column3 LLC.
jonathan at column3.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20090107/f646e0e3/attachment.html>

More information about the Backgroundrb-devel mailing list