[Backgroundrb-devel] worker method not running in background

Jason Sydes jasonsydes at gmail.com
Tue Dec 5 13:13:44 EST 2006

On 12/5/06, tom roth <rawdlite at googlemail.com> wrote:
> When i call a worker method my browsers hangs until the task is finished.
> The same code works nicely in the background when inside the do_work method.
> Does this mean i can only start a task in background via the do_work
> method ?
> Or am i doing something wrong here ?

Hi Tom,
You need to call your_method() via work_thread() so that your_method is
wrapped in a (background) ruby thread.  Something like:

your_worker.work_thread(:method => :your_method)
or maybe
your_worker.work_thread(:method => :your_method, :args => some_args)

If you try calling do_work directly (instead of via new_worker()) I'd expect
your browser to hang as well.

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061205/d92e38f3/attachment.html 

More information about the Backgroundrb-devel mailing list