You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

waitfor.html 3.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Apache Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2>Waitfor</h2>
  8. <h3>Description</h3>
  9. <p>Blocks execution until a set of specified conditions become true. This is intended
  10. to be used with the <a href="parallel.html">parallel</a> task to
  11. synchronize a set of processes.</p>
  12. <p>The conditions to wait for are defined in <a href="waitfor.html#nested">nested elements</a>, if multiple conditions
  13. are specified, then the task will wait until all conditions are true..</p>
  14. <p></p>
  15. <p>The time attributes (maxwait and checkevery) are specified in milliseconds
  16. unless the values are followed by one of the following suffixes: &quot;ms&quot;,
  17. &quot;s&quot;, &quot;m&quot;, &quot;h&quot; which cause the value to be interpreted
  18. as milliseconds, seconds, minutes or hours.</p>
  19. <h3>Parameters</h3>
  20. <table border="1" cellpadding="2" cellspacing="0">
  21. <tr>
  22. <td valign="top"><b>Attribute</b></td>
  23. <td valign="top"><b>Description</b></td>
  24. <td align="center" valign="top"><b>Required</b></td>
  25. </tr>
  26. <tr>
  27. <td valign="top">maxwait</td>
  28. <td valign="top">The maximum amount of time to wait for all the required conditions
  29. to become true before failing the task. Defaults to 5 minutes.</td>
  30. <td valign="top" align="center">No</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">checkevery</td>
  34. <td valign="top">The amount of time to wait between each test of the conditions.
  35. Defaults to 200mS.</td>
  36. <td valign="top" align="center">No</td>
  37. </tr>
  38. </table>
  39. <h3><a name="nested">Nested Elements</a></h3>
  40. <p>The available conditions that satisfy the
  41. <code>&lt;waitfor&gt;</code> task are the same as those for the
  42. <a href="condition.html"><code>&lt;condition&gt;</code></a> task. See
  43. <a href="conditions.html">here</a> for the full list.</p>
  44. <h3>Examples</h3>
  45. <blockquote>
  46. <p><code>&lt;waitfor maxwait=&quot;30s&quot;&gt;<br>
  47. &nbsp;&nbsp;&nbsp;&nbsp;&lt;available file="errors.log"/&gt;<br>
  48. &lt;/waitfor&gt;</code></p>
  49. </blockquote>
  50. <p>waits up to 30 seconds for a file called errors.log to appear.</p>
  51. <blockquote>
  52. <p><code>&lt;waitfor maxwait=&quot;3m&quot; checkevery=&quot;500ms&quot;&gt;<br>
  53. &nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://localhost/myapp/index.html&quot;/&gt;<br>
  54. &lt;/waitfor&gt;</code></p>
  55. </blockquote>
  56. <p>waits up to 3 minutes (and checks every 500mS) for a web server on localhost
  57. to serve up the specified URL.</p>
  58. <blockquote>
  59. <p><code>&lt;waitfor maxwait=&quot;10s&quot;&gt;<br>
  60. &nbsp;&nbsp;&nbsp;&nbsp;&lt;and&gt;<br>
  61. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;socket server=&quot;dbserver&quot; port=&quot;1521&quot;/&gt;<br>
  62. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://webserver/mypage.html&quot;/&gt;<br>
  63. &nbsp;&nbsp;&nbsp;&nbsp;&lt;/and&gt;<br>
  64. &lt;/waitfor&gt;</code></p>
  65. </blockquote>
  66. <p>waits up to 10 seconds for a server on the dbserver machine to begin listening
  67. on port 1521 and for the http://webserver/mypage.html web page
  68. to become available.</p>
  69. <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  70. Reserved.</p>
  71. </body>
  72. </html>