Probe¶
-
class
conu.
Probe
(timeout=1, pause=1, count=-1, expected_exceptions=(), expected_retval=True, fnc=<class 'bool'>, **kwargs)¶ Probe can be used for waiting on specific result of a function. Probe ends when function returns expected_retval or timeout is exceeded.
-
__init__
(timeout=1, pause=1, count=-1, expected_exceptions=(), expected_retval=True, fnc=<class 'bool'>, **kwargs)¶ Parameters: - timeout – Number of seconds spent on trying. Set timeout to -1 for infinite run.
- pause – Number of seconds waited between multiple function result checks
- count – Maximum number of tries, defaults to infinite, represented by -1
- expected_exceptions – When one of expected_exception is raised, probe ignores it and tries to run function again. To ignore multiple exceptions use parenthesized tuple.
- expected_retval – When expected_retval is received, probe ends successfully
- fnc – Function which run is checked by probe
-