# Function/Method Execution Progress Bar

**URL:** <https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382>\
**Category:** Rails\
**Created:** [June 25, 2006, 2:59am UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382 "2006-06-25T02:59:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roland](https://www.ruby-forum.com/u/roland)\
**Post date:** [June 25, 2006, 2:59am UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382/1 "2006-06-25T02:59:37Z")

</div>

Hello,

I want to create a progress bar for the exececution of a particular  
function.

I found a solution at [http://brainspl.at/articles/tag/background](http://brainspl.at/articles/tag/background) but one  
need to create a separate server that communicates the progress of a  
job.

Is there anyways to change a global variable or so and have the user see  
the execution stage of the function?

I tried playing with Thread but no success because for the page to be  
loaded the thread must finish.

Thanks for your time,

Roland

---

<div class="post-metadata">

**Author:** ![roland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roland](https://www.ruby-forum.com/u/roland)\
**Post date:** [June 25, 2006, 4:31am UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382/2 "2006-06-25T04:31:53Z")

</div>

[http://rails.techno-weenie.net/question/2005/12/24/how\_do\_you\_display\_the\_progress\_of\_a\_long\_running\_action](http://rails.techno-weenie.net/question/2005/12/24/how_do_you_display_the_progress_of_a_long_running_action)

-Jonathan.

---

<div class="post-metadata">

**Author:** ![roland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roland](https://www.ruby-forum.com/u/roland)\
**Post date:** [June 25, 2006, 2:30pm UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382/3 "2006-06-25T14:30:17Z")

</div>

Thanks Jonathan,

brainspl.at is blog of “ezmobius” who proposed the solution with the drb  
server.

Actually, I did implement before reading this blog the solution by  
“madrobby” but that does not work because Rails does not respond the  
ajax call while processing a function.

Thanks for the answer,

Roland

---

<div class="post-metadata">

**Author:** ![roland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roland](https://www.ruby-forum.com/u/roland)\
**Post date:** [June 26, 2006, 5:30am UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382/4 "2006-06-26T05:30:57Z")

</div>

Thanks a bunch Jonathan. It worked fine. It’s a great resource to have  
such functionality.

Roland

---

<div class="post-metadata">

**Author:** ![roland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3ab097/32.png) [@roland](https://www.ruby-forum.com/u/roland)\
**Post date:** [June 26, 2006, 1:38am UTC](https://www.ruby-forum.com/t/function-method-execution-progress-bar/64382/5 "2006-06-26T01:38:32Z")

</div>

You need to use a multithreaded web server, not Webrick. Lighttpd should  
do.

-Jonathan
