# AJAX updates for execution progress status

**URL:** <https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479>\
**Category:** Rails\
**Created:** [July 8, 2008, 11:49am UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479 "2008-07-08T11:49:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 8, 2008, 11:49am UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/1 "2008-07-08T11:49:11Z")

</div>

I need to update multiple areas on my page within the same controller,  
where statuses are updated as test scripts are being run and completed.  
My js first renders a list of the available test cases to run, then I  
have a loop running the execution of each script and doing a  
page.replace\_html, but nothing is rendered until everything has finished  
executing.

I’m wondering how I can display the list first, then have the statuses  
being updated on the page during the test script execution instead?

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 8, 2008, 12:31pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/2 "2008-07-08T12:31:49Z")

</div>

On Tue, Jul 8, 2008 at 7:49 PM, Michelle Li  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to update multiple areas on my page within the same controller,  
> where statuses are updated as test scripts are being run and completed.  
> My js first renders a list of the available test cases to run, then I  
> have a loop running the execution of each script and doing a  
> page.replace\_html, but nothing is rendered until everything has finished  
> executing.

> I’m wondering how I can display the list first, then have the statuses  
> being updated on the page during the test script execution instead?

You want something along the lines of periodically call remote.

I did something vaguely like this and made a little screen cast  
somewhere… lemmie look…

OK, found it:

> **[The Construction Blog - Tips on Choosing Local Construction Companies](http://www.blognow.com.au)**
>
> Tips on Choosing Local Construction Companies

And the tutorial:

> **[The Construction Blog - Tips on Choosing Local Construction Companies](http://www.blognow.com.au)**
>
> Tips on Choosing Local Construction Companies

Hope that helps

Mikel

–

> **[Mikel Lindsaar](https://lindsaar.net/)**
>
> Internet Home for Mikel Lindsaar

Rails, RSpec and Life blog…

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 14, 2008, 11:49am UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/3 "2008-07-14T11:49:21Z")

</div>

Thanks Mikel, I checked out your screencast and that looks really neat.

I installed the backgroundrb plugin along with the chronic and packet  
gems but when I try starting the server using:

script/background start

I get the following error in my log file:

/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:266:in  
`load_missing_constant': uninitialized constant BackgrounDRb::Rails (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const\_missing’  
from  
/home/mil1/QA/svn/QaEngine/trunk/lib/workers/execute\_script\_worker.rb:1  
from /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' from /home/mil1/QA/svn/QaEngine/trunk/vendor/plugins/backgroundrb/server/lib/master_proxy.rb:37:in `find\_reloadable\_worker’  
from  
/home/mil1/QA/svn/QaEngine/trunk/vendor/plugins/backgroundrb/server/lib/master\_proxy.rb:35:in  
`map' from /home/mil1/QA/svn/QaEngine/trunk/vendor/plugins/backgroundrb/server/lib/master_proxy.rb:35:in `find\_reloadable\_worker’  
from  
/home/mil1/QA/svn/QaEngine/trunk/vendor/plugins/backgroundrb/server/lib/master\_proxy.rb:12:in  
`initialize' from script/backgroundrb:46:in `new’  
from script/backgroundrb:46

I can’t seem to figure it out and I’ve tried reinstalling the plugin a  
few times. Would you have any idea what would be the problem?

Thanks,  
Michelle

Mikel L. wrote:

> On Tue, Jul 8, 2008 at 7:49 PM, Michelle Li  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I need to update multiple areas on my page within the same controller,  
> > where statuses are updated as test scripts are being run and completed.  
> > My js first renders a list of the available test cases to run, then I  
> > have a loop running the execution of each script and doing a  
> > page.replace\_html, but nothing is rendered until everything has finished  
> > executing.
> 
> > I’m wondering how I can display the list first, then have the statuses  
> > being updated on the page during the test script execution instead?
> 
> You want something along the lines of periodically call remote.
> 
> I did something vaguely like this and made a little screen cast  
> somewhere… lemmie look…
> 
> OK, found it:
> 
> [The Construction Blog - Tips on Choosing Local Construction Companies](http://www.blognow.com.au/q/64767/Screen_cast_of_multiple_progress_bar_tracker.html)
> 
> And the tutorial:
> 
> [The Construction Blog - Tips on Choosing Local Construction Companies](http://www.blognow.com.au/q/64722/Ruby_on_Rails_and_BackgroundRB_-_multiple_progress_bars_with_ActiveScaffold.html)
> 
> Hope that helps
> 
> Mikel
> 
> –  
> [http://lindsaar.net/](http://lindsaar.net/)  
> Rails, RSpec and Life blog…

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 14, 2008, 1:16pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/4 "2008-07-14T13:16:46Z")

</div>

On Mon, Jul 14, 2008 at 3:19 PM, Michelle Li  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:266:in  
> `load\_missing\_constant’: uninitialized constant BackgrounDRb::Rails  
> (NameError)  
> from

That screencast is cool, albeit a bit old(meaning your worker code is  
wrong, in all probability).

You want to perhaps refer:

[http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)

Also, there is a mailing list and IRC channel for BackgrounDRb, where  
you can ask questions if in doubt.

(IRC, is not very active all the time).

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 14, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/5 "2008-07-14T13:28:30Z")

</div>

On Mon, Jul 14, 2008 at 4:51 PM, Michelle Li  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yup I had followed the instructions on the rubyforge page just to set up  
> the BackgrounDRb without actually setting up any of my own workers. I  
> just try to start the server and I can’t get it running…

You are trying to inherit BackgrounDRb::Rails in your worker code(as  
seen from exception), and that class no longer exists(it has been  
removed like 6 months back) and hence I asked you to read the  
documentation and try.

An empty worker looks like:

class BillingWorker \< BackgrounDRb::MetaWorker  
set\_worker\_name :billing\_worker  
def create(args = nil)  
# method gets called, when new instance of worker is created.  
end  
end

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 15, 2008, 1:13pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/6 "2008-07-15T13:13:55Z")

</div>

Thanks for the help, I began running server and played around using  
MiddleMan to create new workers in the client terminal. However, when I  
try to use methods such as delete\_worker() or send\_request() I get  
errors such as this:

NoMethodError: undefined method `delete\_worker’ for  
#BackgrounDRb::ClusterConnection:0xb7496648

In my background.yml file I only have the following specified so it  
doesn’t seem like I’m using any clustering:

* * *

:backgroundrb:  
:ip: 0.0.0.0  
:port: 11008

Sorry for all the noob questions.

Thanks!

Hemant K. wrote:

> On Mon, Jul 14, 2008 at 4:51 PM, Michelle Li  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Yup I had followed the instructions on the rubyforge page just to set up  
> > the BackgrounDRb without actually setting up any of my own workers. I  
> > just try to start the server and I can’t get it running…
> 
> You are trying to inherit BackgrounDRb::Rails in your worker code(as  
> seen from exception), and that class no longer exists(it has been  
> removed like 6 months back) and hence I asked you to read the  
> documentation and try.
> 
> An empty worker looks like:
> 
> class BillingWorker \< BackgrounDRb::MetaWorker  
> set\_worker\_name :billing\_worker  
> def create(args = nil)  
> # method gets called, when new instance of worker is created.  
> end  
> end

---

<div class="post-metadata">

**Author:** ![miss\_michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@miss\_michelle](https://www.ruby-forum.com/u/miss_michelle)\
**Post date:** [July 14, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/ajax-updates-for-execution-progress-status/142479/7 "2008-07-14T13:21:00Z")

</div>

Yup I had followed the instructions on the rubyforge page just to set up  
the BackgrounDRb without actually setting up any of my own workers. I  
just try to start the server and I can’t get it running…

Hemant K. wrote:

> On Mon, Jul 14, 2008 at 3:19 PM, Michelle Li  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:266:in  
> > `load\_missing\_constant’: uninitialized constant BackgrounDRb::Rails  
> > (NameError)  
> > from
> 
> That screencast is cool, albeit a bit old(meaning your worker code is  
> wrong, in all probability).
> 
> You want to perhaps refer:
> 
> [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)
> 
> Also, there is a mailing list and IRC channel for BackgrounDRb, where  
> you can ask questions if in doubt.
> 
> (IRC, is not very active all the time).
