Debian Codegraph @

docs/manual/tasks/limit_task.html

raw symbols SCIP
1 <html>
2 <head>
3 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4 <title>
5 Chapter&nbsp;10.&nbsp;Limit</title>
6 <meta content="DocBook XSL Stylesheets V1.60.1" name="generator">
7 <link rel="home" href="index.html" title="Antelope Users Guide">
8 <link rel="up" href="bk03.html" title="Additional Ant Tasks">
9 <link rel="previous" href="bk03ch09.html" title="Chapter&nbsp;9.&nbsp;Stopwatch">
10 <link rel="next" href="bk03ch11.html" title="Chapter&nbsp;11.&nbsp;Math">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <div class="chapter" lang="en">
14 <div class="titlepage">
15 <div>
16 <div>
17 <h2 class="title">
18 <a name="Limit">
19 </a>
20 Limit</h2>
21 </div>
22 </div>
23 <div>
24 </div>
25 </div>
26 <p>
27
28 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.
29 </p>
30
31 <p>
32
33 <div class="table">
34 <a name="N1096A">
35 </a>
36 <p class="title">
37 <b>
38 Table&nbsp;10.1.&nbsp;Limit Task Attributes</b>
39 </p>
40 <table summary="Limit Task Attributes" border="1">
41 <colgroup>
42 <col>
43 <col>
44 <col>
45 <col>
46 </colgroup>
47 <thead>
48 <tr>
49 <th>
50 Attribute</th>
51 <th>
52 Description</th>
53 <th>
54 Default</th>
55 <th>
56 Required</th>
57 </tr>
58 </thead>
59 <tbody>
60 <tr>
61 <td>
62 maxwait</td>
63 <td>
64 How long to wait for nested tasks to finish.</td>
65 <td>
66 180 seconds (3 minutes)</td>
67 <td>
68 No</td>
69 </tr>
70
71 <tr>
72 <td>
73 maxwaitunit</td>
74 <td>
75 The unit for maxwait. Valid values are "millisecond", "second", "minute", "hour", "day", "week".</td>
76 <td>
77 seconds</td>
78 <td>
79 No</td>
80 </tr>
81
82 <tr>
83 <td>
84 failonerror</td>
85 <td>
86 Should the build fail if the time limit has been exceeded?</td>
87 <td>
88 false</td>
89 <td>
90 No</td>
91 </tr>
92
93 <tr>
94 <td>
95 property</td>
96 <td>
97 The name of a property to set if the max wait time is exceeded.</td>
98 <td>
99 none</td>
100 <td>
101 No</td>
102 </tr>
103
104 <tr>
105 <td>
106 value</td>
107 <td>
108 The value to set for the property if the max wait time is exceeded.</td>
109 <td>
110 true</td>
111 <td>
112 No</td>
113 </tr>
114
115 <tr>
116 <td>
117 milliseconds</td>
118 <td>
119 How long to wait in milliseconds.</td>
120 <td>
121 3 minutes</td>
122 <td>
123 No</td>
124 </tr>
125
126 <tr>
127 <td>
128 seconds</td>
129 <td>
130 How long to wait in seconds.</td>
131 <td>
132 3 minutes</td>
133 <td>
134 No</td>
135 </tr>
136
137 <tr>
138 <td>
139 minutes</td>
140 <td>
141 How long to wait in minutes.</td>
142 <td>
143 3 minutes</td>
144 <td>
145 No</td>
146 </tr>
147
148 <tr>
149 <td>
150 hours</td>
151 <td>
152 How long to wait in hours.</td>
153 <td>
154 3 minutes</td>
155 <td>
156 No</td>
157 </tr>
158
159 <tr>
160 <td>
161 days</td>
162 <td>
163 How long to wait in days.</td>
164 <td>
165 3 minutes</td>
166 <td>
167 No</td>
168 </tr>
169
170 <tr>
171 <td>
172 weeks</td>
173 <td>
174 How long to wait in weeks.</td>
175 <td>
176 3 minutes</td>
177 <td>
178 No</td>
179 </tr>
180
181
182 </tbody>
183 </table>
184 </div>
185
186 </p>
187 <p>
188
189 Examples:
190 </p>
191 <p>
192
193 Neither the echo nor the fail will happen in this example. The build will continue once the time has expired.
194 <table border="0" bgcolor="#E0E0E0">
195 <tr>
196 <td>
197 <pre class="programlisting">
198
199
200 &lt;limit maxwait="3"&gt;
201 &lt;sleep seconds="10"/&gt;
202 &lt;echo&gt;This won't happen...&lt;/echo&gt;
203 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
204 &lt;/limit&gt;
205
206 </pre>
207 </td>
208 </tr>
209 </table>
210
211 </p>
212 <p>
213
214 This is identical to the above example, but uses the convenience "seconds" attribute:
215 <table border="0" bgcolor="#E0E0E0">
216 <tr>
217 <td>
218 <pre class="programlisting">
219
220
221 &lt;limit seconds="3"&gt;
222 &lt;sleep seconds="10"/&gt;
223 &lt;echo&gt;This won't happen...&lt;/echo&gt;
224 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
225 &lt;/limit&gt;
226
227 </pre>
228 </td>
229 </tr>
230 </table>
231
232 </p>
233 <p>
234
235 Neither the echo nor the fail will happen in this example. The build will not continue once the time has expired.
236 <table border="0" bgcolor="#E0E0E0">
237 <tr>
238 <td>
239 <pre class="programlisting">
240
241
242 &lt;limit maxwait="3" failonerror="true"&gt;
243 &lt;sleep seconds="10"/&gt;
244 &lt;echo&gt;This won't happen...&lt;/echo&gt;
245 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
246 &lt;/limit&gt;
247
248 </pre>
249 </td>
250 </tr>
251 </table>
252
253 </p>
254 <p>
255
256 The limit will be reached and a property will be set indicating so.
257 <table border="0" bgcolor="#E0E0E0">
258 <tr>
259 <td>
260 <pre class="programlisting">
261
262
263 &lt;limit minutes="3" property="limit_reached"&gt;
264 &lt;sleep minutes="10"/&gt;
265 &lt;echo&gt;This won't happen...&lt;/echo&gt;
266 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
267 &lt;/limit&gt;
268 &lt;echo&gt;limit_reached = ${limit_reached)&lt;/echo&gt;
269 </pre>
270 </td>
271 </tr>
272 </table>
273
274 </p>
275 </div>
276 <hr>
277 <p align="center">Copyright &copy; 2003-2004 Ant-Contrib Project. All
278 rights Reserved.</p>
279 </body>
280 </html>