nvflare.fuel.utils.waiter_utils module¶
- conditional_wait(waiter: Event, timeout: float, abort_signal: Signal, condition_cb=None, **cb_kwargs)[source]¶
Wait for an event until timeout, aborted, or some condition is met.
- Parameters:
waiter – the event to wait
timeout – the max time to wait
abort_signal – signal to abort the wait
condition_cb – condition to check during waiting
**cb_kwargs – kwargs for the condition_cb
- Returns: return code to indicate how the waiting is stopped:
IS_SET: the event is set TIMEOUT: the event timed out ABORTED: abort signal is triggered during the wait ERROR: the condition_cb encountered unhandled exception OK: only used by the condition_cb to say “all is normal” other integers: returned by condition_cb for other conditions met