Welcome Guest | Login

BackgrounDRb

I would like to trigger a process from a Rails interface, to run in the background without waiting for the full HTTP request/response cycle.  The process isn't particularly memory intensive, but it does take long enough that it isn't worth requiring the user to wait for its completion.  

I can see from a search on the forum threads that backgroundDRb is already installed at HostingRails.  Is any documentation available that would help to configure/use this facility with my HostingRails account?  

Thank you,

-Arlen

2008-03-12 09:27 AM

Hi Arlen, the best documentation can be found at their new site:
http://backgroundrb.rubyforge.org/

I've installed the chronic and packet gems for you on your server, so just get the plugin in your app and follow along.  Let us know if you run into any trouble.

2008-03-12 02:09 PM

Thank you, William - I'll take a look at the documentation this morning.  

2008-03-13 07:28 AM

Hello,

I used to have Drb up and running with mongrel_upload_progress, but it seems that some things have changed and I'm now a little confused.  It's stopped working on my site, so I'd like to get it set up again.

Is BackgrounDrb already installed?  It is not listed as either BackgrounDrb or Drb when I do gem list --local.  I try running 'rake backgroundrb:setup', only to get the error:

'Don't know how to build task 'backgroundrb:setup'

Where should I go from here?

2008-03-15 12:52 PM

To install BackgrounDRb you need to follow these steps:

1. Install the plugin in your vendor/plugins directory

$ script/plugin install svn://rubyforge.org/var/svn/backgroundrb

2. To install start stop scripts and worker dir:
$ rake backgroundrb:setup

2008-03-15 02:12 PM

Thanks Muxyd, that helped.  I have another question now, which perhaps you can help me with also:

when you run 'rake backgroundrb:setup' it creates a backgroundrb.yml config file.  On the page the William linked to, the format of the config file is like this:

:backgroundrb:
 :port: 11006
 :ip: 0.0.0.0

However, the format that's created when I run the rake task is like this:

---
port: "4***9"  (actual port, not stars)
timer_sleep: 60
load_rails: true
environment: production
host: localhost
database_yml: config/database.yml
acl:
 deny: all
 allow: localhost 127.0.0.1
 order: deny,allow

I'm just assuming that this is a newer, yet to be documented way of writing the config file?  Also, would the information in that second config be the information that I want?

With this information, my current problem is that, after following this tutorial: http://mongrel.rubyforge.org/wiki/UploadProgress, I never see any uploads when I do

(DRbObject.new nil 'druby://127.0.0.1:40289').list

Don't want to change the topic necessarily, but I don't know if this is a DRb issue or a mongrel_upload_progress issue.

2008-03-15 05:40 PM

Ok, I figured out what my problem was.  After looking around in the wrong places, I noticed that I was getting a lot of:

NameError (uninitialized constant Mongrel::Uploads)

errors in my production.log.  So, I had to restart my Mongrel cluster with the line:

-S config/mongrel_upload_progress.conf

Forgot all about that.  Maybe someone can help me out with this, though: the -S line doesn't need to be appended every time the cluster is restarted, so when would it have to be added, exactly?  I mean, when would the mongrel cluster config have reset?  On a server reboot?

2008-03-15 08:06 PM

The -S option is working fine for your app.

I tried " mongrel_rails cluster::restart" and the mongrels were restarted with script option enabled.

You can verify this by typing "ps" in your command console.

2008-03-15 08:51 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!