[Backgroundrb-devel] backgroundrb preview

hemant
2006-11-06T05:25:48Z

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.