# Application design : background process

**URL:** <https://www.ruby-forum.com/t/application-design-background-process/167878>\
**Category:** Rails\
**Created:** [May 13, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/application-design-background-process/167878 "2009-05-13T16:01:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [May 13, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/application-design-background-process/167878/1 "2009-05-13T16:01:59Z")

</div>

Hi im making a simple app which takes a users search term and scrapes  
several sites rss feeds for relevant results. The scrape can take upto  
10seconds. I want to make this a background process so I can update the  
user with the scrapes status(“currently scraping site x”) and present  
results as they are scraped.

Im looking at backgroundrb and have read a guide in Advanced Rails  
Recipe however thats for an older version of backgroundrb and the api  
has changed. So im a little confused - im also new to processes and  
threads.

If my worker is responsible for scraping each site and providing updates  
do I have one worker which will be used by all the users currently  
online? I guess I then can use threads to process multiple search  
requests at times when the site is busy.

OR

do i create a new worker for each user? Would this also allow for  
concurrent processing?

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [May 13, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/application-design-background-process/167878/2 "2009-05-13T16:09:53Z")

</div>

I would use Workling + Starling, or the run\_later plugin. You can find  
all of them at Github.

On Wed, May 13, 2009 at 4:01 PM, Adam A.

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [May 13, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/application-design-background-process/167878/3 "2009-05-13T16:40:28Z")

</div>

can they perform tasks dynamically i.e. a task is initiated on a users  
mouse click. I thought i saw a railscast that said they were only good  
for prescheduled tasks.

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [May 13, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/application-design-background-process/167878/4 "2009-05-13T17:00:27Z")

</div>

On Wed, May 13, 2009 at 4:40 PM, Adam A.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> can they perform tasks dynamically i.e. a task is initiated on a users  
> mouse click. I thought i saw a railscast that said they were only good  
> for prescheduled tasks.

I’ve used them to send process to background, for a long running task,  
for example deliver a newsletter to thousands of users, which is a  
process which can take some time.
