Forum: Ruby on Rails How to run a background task in rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-08 08:58
I need to run a background task which should last several hours. How can
I do this in rails?
9cf6e7f81d4339295b86e5fb7d7df49b?d=identicon&s=25 Vishwanath Nayak (nayak)
on 2009-01-08 09:28
(Received via mailing list)
Hi,

What sort of tasks do you intend to do?
Database/ file system/ operating system oriented, appropriate approach
can
be decided depending on these

- NAYAK
29ebf90af6107d2eb39b587c7972639c?d=identicon&s=25 Mukund (Guest)
on 2009-01-08 10:05
(Received via mailing list)
Use the backgroundrb system. It scales better in the long run as you
decide to do more stuff in the background and require better control.

http://backgroundrb.rubyforge.org/
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-08 10:07
Vishwanath Nayak wrote:
> Hi,
>
> What sort of tasks do you intend to do?
> Database/ file system/ operating system oriented, appropriate approach
> can
> be decided depending on these
>
> - NAYAK

The task is building source code with gcc.
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-01-08 10:16
(Received via mailing list)
> The task is building source code with gcc.
take a look at the earlier mentioned backgrounDRb:
http://backgroundrb.rubyforge.org/

[quote]
BackgrounDRb is a Ruby job server and scheduler. Its main intent is to
be used with Ruby on Rails applications for offloading long-running
tasks. Since a Rails application blocks while serving a request it is
best to move long-running tasks off into a background process that is
divorced from http request/response cycle.
[/quote]
9cf6e7f81d4339295b86e5fb7d7df49b?d=identicon&s=25 Vishwanath Nayak (nayak)
on 2009-01-08 10:25
(Received via mailing list)
I second on it

-NAYAK
This topic is locked and can not be replied to.