awaitAny

abstract suspend fun awaitAny(vararg commands: Command): Command

Runs all commands inline, suspending until any of them is done. Returns the first one that completes.

The winner is ended with EndCondition.NATURALLY and every other command with EndCondition.INTERRUPTED.

Throws

if commands is empty, since there would be nothing to return


open suspend fun awaitAny(commands: Collection<Command>): Command

Runs all commands inline, suspending until any of them is done. Returns the first one that completes.

Throws

if commands is empty, since there would be nothing to return