YuiRestClient::Wait - Wait for something
Copyright 2020 SUSE LLC
SPDX-License-Identifier: FSFAP
QE Yam <qe-yam at suse de>
wait_until ( object => sub {...}, timeout => 10, interval => 1, message => '');
This class implements a method to wait for external triggers. The trigger is defined as a parameter called object which should define a sub that e.g. runs external commands. The method waits for a defined amount of time if the object function returned a value, if not it will die with a timeout message.
wait_until(%args) - Wait until trigger or timeout
The %args hash has the following named elements:
{object} - defines the external function that should return a value within the specified time. If no object is provided the method will die with an error message.
{timeout} - defines the time to wait in seconds for the trigger to occur. The default is 10.
{intervall} - defines how many seconds to wait before evaluating the object function again. The default is 1.
{message} - the error message that is used when the method timed out.
With all defaults this means, that the object function is evaluated every second for a maximum time of 10 seconds. If the object function does not succeed then the method dies and displays the error message. If the object function returned an error code in $@ then this error will be appended to the message.