Control flow methods
There are some helper methods which might be useful when writing code using ox’s concurrency operators:
forever { ... }
repeatedly evaluates the given code block foreverrepeatWhile { ... }
repeatedly evaluates the given code block, as long as it returnstrue
repeatUntil { ... }
repeatedly evaluates the given code block, until it returnstrue
never
blocks the current thread indefinitely, until it is interruptedcheckInterrupt()
checks if the current thread is interrupted, and if so, throws anInterruptedException
. Useful in compute-intensive code, which wants to cooperate in the cancellation protocol
All of these are inline
methods, imposing no runtime overhead.