View Source WaitForIt.Waitable protocol (WaitForIt v2.1.2)
Protocol used for evaluating waitable expressions against waiting conditions to determine if waiting should continue or halt with a final value.
Summary
Functions
Evaluates the waitable expression to provide its value, or to continue to wait.
Provides the final value of the waitable expression in the event of a timeout.
Types
Functions
@spec evaluate(t(), Macro.Env.t()) :: {:halt, value()} | {:cont, value()}
Evaluates the waitable expression to provide its value, or to continue to wait.
It should return {:halt, value}
if the wait is over and the final value of the waitable
expression has been determined, or {:cont, value}
if waiting should continue.
@spec handle_timeout(t(), value(), Macro.Env.t()) :: value()
Provides the final value of the waitable expression in the event of a timeout.