[Backgroundrb-devel] worker starting twice

Jack Nutting jnutting at gmail.com
Wed Mar 14 17:37:46 EDT 2007

On 3/14/07, Mason Hale <masonhale at gmail.com> wrote:
> My understanding is that for scheduled workers, the do_work method is called
> automatically when the worker is created (which provides an opportunity for
> any initialization, if necessary), and subsequently the :worker_method
> specified in the backgroundrb_schedules.yml file is called on the specified
> schedule.
> If your worker_method is specified as :do_work, then your :do_work method
> will be called twice, once when the worker is created, and again when the
> schedule is invoked. Note that these separate calls can occur in separate
> threads. So if you do use the call to do_work at creation time to do some
> initialization, you will need to set a flag internally to let other
> (potentially simultaneous) calls to your :worker_method behave appropriately
> if called be initialization is complete.

Ahhhh!  Now it all makes sense.  Thanks!

// jack
// http://www.nuthole.com

More information about the Backgroundrb-devel mailing list