[Backgroundrb-devel] backgroundrb preview

hemant gethemant at gmail.com
Mon Nov 6 00:25:48 EST 2006


On 11/6/06, skaar <skaar at waste.org> wrote:
> * skaar (skaar at waste.org) [061104 21:38]:
> > >     worker.read_from_socket  ##### interesting line #666
> > >
> > > now..on #666, how do i make sure..that controller just triggers the
> > > method in worker and control comes back to the controller immediately.
> > > Sounds like a typical use case of threads.
> >
> > it's not yet documented, but used internally for do_work, but you could
> > call:
> >
> >    worker.work_thread(:method => :read_from_socket)
> >
> > which will run the method in a separate thread in the worker process. (I
> > would have to werify how work_thread behaves without arguments, but we
> > can deal with that - please submit a ticket if you find that it doesn't
> > work).
>
> ok, the above will in 0.2.1 (and from trunk r142) work as adverticed,
> you can use work_thread to background in the worker any method, with or
> without arguments.
>
> For now you will have to device a way in the worker to determine when
> the method is done doing it's work.
>
> Worker exceptions are logged in backgroundrb.log. There is currently
> little indication in the MiddleMan if an exception has occured in the
> worker, but in the case an exception occur, the worker will be deleted.

no problem..I have an instance variable..that takes care... if the
worker has finished its execution.

-- 
There was only one Road; that it was like a great river: its springs
were at every doorstep, and every path was its tributary.


More information about the Backgroundrb-devel mailing list