There are similar tasks with "timeout" attribute. <exec> task with timeout attribute Stop the command if it doesn't finish within the specified time (given in milliseconds).
<parallel> task with timeout attribute Number of milliseconds before execution is terminated Koji ==================================== Technical Support Blue Martini Software K.K. Shinbashi Chuo Building 6th Floor 1-11-5 Nishi-shinbashi, Minato-ku Tokyo 105-0003 Japan Tel: 81-3-5521-6670 Fax: 81-3-5521-6671 www.bluemartini.co.jp > -----Original Message----- > From: Dale Anson [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 19, 2004 6:59 AM > To: Ant Users List > Subject: Re: <timer /> task created > > > Robert, > > A similar task exists in Ant-Contrib, the "limit" task. Maybe you can > see if there are features your task has that the "limit" task doesn't > have, and the two can be combined? > > The on-line ant-contrib documentation is not up to date, but you can see > reasonably current docs for "limit" at > http://antelope.smartpennies.com/manual/bk03ch10.html. > > Dale > > > Robert Rice wrote: > > > I recently created a <timer /> task, for limiting the execution > time of a > > series of nested tasks. > > > > Why did I create such a thing? In my case, I > > utilize ant to perform a number of lengthy ftp and http get's against a > > long list of files. At times, these processes will "hang". In other > > words, not complete in a timely fashion and not fail. I wanted > to be able > > to limit this behavior. > > > > I thought I would ping this list to see if such a task is > useful to other > > users, possibly ( hopefully ) for completely different reasons. If it > > proves useful, how do I contribute this new ( non patch ) code? > Further > > class details are included below. > > > > Thanks > > Robert Rice > > > > Here are more specifics about the <timer /> class: > > > > This class is designed to limit the maximum execution time for > a series of > > tasks. This limit is the total time allowed for all contained tasks. > > > > The following exit strategies are provided by the timer task: > > > > * If the time limit is reached, the current task will be > interrupted > > and no more contained tasks will be executed. > > * If a BuildException is thrown by the current task, no > more contained > > tasks will be executed. > > * The timer task will exit normally if all contained tasks complete > > execution prior to the maximum time limit. > > > > This class utilizes the Unit EnumeratedAttribute of the > <waitfor /> task. > > This was > > done to share a bit of the timer functionality plus adhere to its > > attribute naming conventions. In a way, this class is somewhat of a > > combination of the <waitfor /> task and the <sequential />task. > This task > > can be used in conjunction > > with <parallel /> and <sequential /> tasks. > > > > The following attributes can be specified on a timer task: > > > > * maxwait - maximum length of time to wait before giving up > > * maxwaitunit - The unit to be used to interpret maxwait attribute > > * timeoutproperty - name of a property to set if maxwait has been > > exceeded. > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
