Function useWaitableFunction

A waitable that gets its state from the result of the specified function.

Results must be wrapped and marked as ok (success) or not (error).

This is likely a more natural form to work with in cases that don't require the ability to call setSuccess or setFailure more than once during a single run.