Hi Thorsten, it would really be a nice feature to have a stop and a pause functionality.
I would propose to add a stop() method to the Droid API, which internally calls taskmaster.stop(). So terminated could be a private member of the TaskMaster, which should be set to false, when calling taskmaster.stop(). BTW There is already a stop() method on the MultiThreadedTaskMaster which is not visible through the API. But I never used it ... Tobias On Wed, Feb 27, 2013 at 9:28 PM, Thorsten Scherler <[email protected]>wrote: > Hi all, > > I wonder how is the best way to stop a running droid? > > Imaging you have a process like a web form that invokes the crawling via > an ajax call. Now you may know the jenkins feature to see the build logs > in real time. Imagine you see the droids logs that way and you spot a > bug/problem which you need to fix before the droid can proceed. > Sometimes you may be interested to simply pause the crawling since you > can do a hotfix or sometimes you just need to finish that crawl. > > Now in the taskMaster we control whether a droid has finished in public > synchronized void start(final Queue<T> queue, final Droid<T> droid) with: > > boolean terminated = false; > while (!terminated) { > ... > } > ... > droid.finished(); > > Meaning there is no way to stop the crawling from the outside. However > we could extract terminated as constant and change the interface to have > a stop in the taskMaster. Or do you see better places like maybe > Droid.stop? > > salu2 > > -- > Thorsten Scherler <scherler.at.gmail.com> > codeBusters S.L. - web based systems > <consulting, training and solutions> > > http://www.codebusters.es/ > >
