diff options
Diffstat (limited to 'docs/manual/tasks/limit_task.html')
-rw-r--r-- | docs/manual/tasks/limit_task.html | 280 |
1 files changed, 280 insertions, 0 deletions
diff --git a/docs/manual/tasks/limit_task.html b/docs/manual/tasks/limit_task.html new file mode 100644 index 0000000..fb8f305 --- /dev/null +++ b/docs/manual/tasks/limit_task.html @@ -0,0 +1,280 @@ +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title> +Chapter 10. Limit</title> +<meta content="DocBook XSL Stylesheets V1.60.1" name="generator"> +<link rel="home" href="index.html" title="Antelope Users Guide"> +<link rel="up" href="bk03.html" title="Additional Ant Tasks"> +<link rel="previous" href="bk03ch09.html" title="Chapter 9. Stopwatch"> +<link rel="next" href="bk03ch11.html" title="Chapter 11. Math"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<div class="chapter" lang="en"> +<div class="titlepage"> +<div> +<div> +<h2 class="title"> +<a name="Limit"> +</a> +Limit</h2> +</div> +</div> +<div> +</div> +</div> +<p> + +The Limit task is a task container (that is, it holds other tasks) and sets a time limit on how long the nested tasks are allowed to run. This is useful for unit tests that go awry, hung socket connections, or other potentially long running tasks that need to be shut off without stopping the build. +</p> + +<p> + +<div class="table"> +<a name="N1096A"> +</a> +<p class="title"> +<b> +Table 10.1. Limit Task Attributes</b> +</p> +<table summary="Limit Task Attributes" border="1"> +<colgroup> +<col> +<col> +<col> +<col> +</colgroup> +<thead> +<tr> +<th> +Attribute</th> +<th> +Description</th> +<th> +Default</th> +<th> +Required</th> +</tr> +</thead> +<tbody> +<tr> +<td> +maxwait</td> +<td> +How long to wait for nested tasks to finish.</td> +<td> +180 seconds (3 minutes)</td> +<td> +No</td> +</tr> + +<tr> +<td> +maxwaitunit</td> +<td> +The unit for maxwait. Valid values are "millisecond", "second", "minute", "hour", "day", "week".</td> +<td> +seconds</td> +<td> +No</td> +</tr> + +<tr> +<td> +failonerror</td> +<td> +Should the build fail if the time limit has been exceeded?</td> +<td> +false</td> +<td> +No</td> +</tr> + +<tr> +<td> +property</td> +<td> +The name of a property to set if the max wait time is exceeded.</td> +<td> +none</td> +<td> +No</td> +</tr> + +<tr> +<td> +value</td> +<td> +The value to set for the property if the max wait time is exceeded.</td> +<td> +true</td> +<td> +No</td> +</tr> + +<tr> +<td> +milliseconds</td> +<td> +How long to wait in milliseconds.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + +<tr> +<td> +seconds</td> +<td> +How long to wait in seconds.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + +<tr> +<td> +minutes</td> +<td> +How long to wait in minutes.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + +<tr> +<td> +hours</td> +<td> +How long to wait in hours.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + +<tr> +<td> +days</td> +<td> +How long to wait in days.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + +<tr> +<td> +weeks</td> +<td> +How long to wait in weeks.</td> +<td> +3 minutes</td> +<td> +No</td> +</tr> + + +</tbody> +</table> +</div> + +</p> +<p> + +Examples: +</p> +<p> + +Neither the echo nor the fail will happen in this example. The build will continue once the time has expired. +<table border="0" bgcolor="#E0E0E0"> +<tr> +<td> +<pre class="programlisting"> + + +<limit maxwait="3"> + <sleep seconds="10"/> + <echo>This won't happen...</echo> + <fail>This won't happen either...</fail> +</limit> + +</pre> +</td> +</tr> +</table> + +</p> +<p> + +This is identical to the above example, but uses the convenience "seconds" attribute: +<table border="0" bgcolor="#E0E0E0"> +<tr> +<td> +<pre class="programlisting"> + + +<limit seconds="3"> + <sleep seconds="10"/> + <echo>This won't happen...</echo> + <fail>This won't happen either...</fail> +</limit> + +</pre> +</td> +</tr> +</table> + +</p> +<p> + +Neither the echo nor the fail will happen in this example. The build will not continue once the time has expired. +<table border="0" bgcolor="#E0E0E0"> +<tr> +<td> +<pre class="programlisting"> + + +<limit maxwait="3" failonerror="true"> + <sleep seconds="10"/> + <echo>This won't happen...</echo> + <fail>This won't happen either...</fail> +</limit> + +</pre> +</td> +</tr> +</table> + +</p> +<p> + +The limit will be reached and a property will be set indicating so. +<table border="0" bgcolor="#E0E0E0"> +<tr> +<td> +<pre class="programlisting"> + + +<limit minutes="3" property="limit_reached"> + <sleep minutes="10"/> + <echo>This won't happen...</echo> + <fail>This won't happen either...</fail> +</limit> +<echo>limit_reached = ${limit_reached)</echo> +</pre> +</td> +</tr> +</table> + +</p> +</div> + <hr> + <p align="center">Copyright © 2003-2004 Ant-Contrib Project. All + rights Reserved.</p> +</body> +</html> |