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 4.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>WaitFor Task</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>,
  13. if multiple conditions are specified, then the task will wait until all conditions are true..</p>
  14. <p></p>
  15. <p>If both maxwait and maxwaitunit are not specified, the maxwait is 3 minutes (180000 milliseconds).</p>
  16. <p>If the <code>timeoutproperty</code> attribute has been set, a
  17. property of that name will be created if the condition didn't come
  18. true within the specified time.</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 180000 maxwaitunits.</td>
  30. <td valign="top" align="center">No</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">maxwaitunit</td>
  34. <td valign="top">The unit of time that must be used to interpret the value of the
  35. maxwait attribute. Defaults to millisecond.
  36. Valid Values are
  37. <ul>
  38. <li>millisecond</li>
  39. <li>second</li>
  40. <li>minute</li>
  41. <li>hour</li>
  42. <li>day</li>
  43. <li>week</li>
  44. </ul>
  45. </td>
  46. <td valign="top" align="center">No</td>
  47. </tr>
  48. <tr>
  49. <td valign="top">checkevery</td>
  50. <td valign="top">The amount of time to wait between each test of the conditions.
  51. Defaults to 500 checkeveryunits.</td>
  52. <td valign="top" align="center">No</td>
  53. </tr>
  54. <tr>
  55. <td valign="top">checkeveryunit</td>
  56. <td valign="top">The unit of time that must be used to interpret the value of the
  57. checkevery attribute. Defaults to millisecond.
  58. Valid Values are
  59. <ul>
  60. <li>millisecond</li>
  61. <li>second</li>
  62. <li>minute</li>
  63. <li>hour</li>
  64. <li>day</li>
  65. <li>week</li>
  66. </ul>
  67. </td>
  68. <td valign="top" align="center">No</td>
  69. </tr>
  70. <tr>
  71. <td valign="top">timeoutproperty</td>
  72. <td valign="top">the name of the property to set if maxwait has
  73. been exceeded.</td>
  74. <td valign="top" align="center">No</td>
  75. </tr>
  76. </table>
  77. <h3><a name="nested">Nested Elements</a></h3>
  78. <p>The available conditions that satisfy the
  79. <code>&lt;waitfor&gt;</code> task are the same as those for the
  80. <a href="condition.html"><code>&lt;condition&gt;</code></a> task. See
  81. <a href="conditions.html">here</a> for the full list.</p>
  82. <h3>Examples</h3>
  83. <blockquote>
  84. <p><code>&lt;waitfor maxwait=&quot;30&quot; maxwaitunit=&quot;second&quot;&gt;<br>
  85. &nbsp;&nbsp;&nbsp;&nbsp;&lt;available file="errors.log"/&gt;<br>
  86. &lt;/waitfor&gt;</code></p>
  87. </blockquote>
  88. <p>waits up to 30 seconds for a file called errors.log to appear.</p>
  89. <blockquote>
  90. <p><code>&lt;waitfor maxwait=&quot;3&quot; maxwaitunit=&quot;minute&quot; checkevery=&quot;500&quot;&gt;<br>
  91. &nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://localhost/myapp/index.html&quot;/&gt;<br>
  92. &lt;/waitfor&gt;</code></p>
  93. </blockquote>
  94. <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost
  95. to serve up the specified URL.</p>
  96. <blockquote>
  97. <p><code>&lt;waitfor maxwait=&quot;10&quot; maxwait=&quot;second&quot;&gt;<br>
  98. &nbsp;&nbsp;&nbsp;&nbsp;&lt;and&gt;<br>
  99. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;socket server=&quot;dbserver&quot; port=&quot;1521&quot;/&gt;<br>
  100. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://webserver/mypage.html&quot;/&gt;<br>
  101. &nbsp;&nbsp;&nbsp;&nbsp;&lt;/and&gt;<br>
  102. &lt;/waitfor&gt;</code></p>
  103. </blockquote>
  104. <p>waits up to 10 seconds for a server on the dbserver machine to begin listening
  105. on port 1521 and for the http://webserver/mypage.html web page
  106. to become available.</p>
  107. <hr><p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  108. Reserved.</p>
  109. </body>
  110. </html>