lib/YuiRestClient/Wait.pm

NAME

YuiRestClient::Wait - Wait for something

COPYRIGHT

Copyright 2020 SUSE LLC

SPDX-License-Identifier: FSFAP

AUTHORS

QE Yam <qe-yam at suse de>

SYNOPSIS

wait_until ( object => sub {...}, timeout => 10, interval => 1, message => '');

DESCRIPTION

Overview

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.

Class and object methods

wait_until(%args) - Wait until trigger or timeout

The %args hash has the following named elements:

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.