Blocks execution until a set of specified conditions become true. This is intended to be used with the parallel task to synchronize a set of processes.
The conditions to wait for are defined in nested elements, if multiple conditions are specified, then the task will wait until all conditions are true..
The time attributes (maxwait and checkevery) are specified in milliseconds unless the values are followed by one of the following suffixes: "ms", "s", "m", "h" which cause the value to be interpreted as milliseconds, seconds, minutes or hours.
| Attribute | Description | Required |
| maxwait | The maximum amount of time to wait for all the required conditions to become true before failing the task. Defaults to 5 minutes. | No |
| checkevery | The amount of time to wait between each test of the conditions. Defaults to 200mS. | No |
The available conditions that satisfy the
<waitfor> task are the same as those for the
<condition> task. See
here for the full list.
<waitfor maxwait="30s">
<available file="errors.log"/>
</waitfor>
waits up to 30 seconds for a file called errors.log to appear.
<waitfor maxwait="3m" checkevery="500ms">
<http url="http://localhost/myapp/index.html"/>
</waitfor>
waits up to 3 minutes (and checks every 500mS) for a web server on localhost to serve up the specified URL.
<waitfor maxwait="10s">
<and>
<socket server="dbserver" port="1521"/>
<http url="http://webserver/mypage.html"/>
</and>
</waitfor>
waits up to 10 seconds for a server on the dbserver machine to begin listening on port 1521 and for the http://webserver/mypage.html web page to become available.
Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.