anyOf equivalent of Kotlin Deffered


Coroutine async returns Deferred and there are example of lazy execution and usages of await.

However how can we wait for any of the Deffered instances to complete?

In a nutshell

  // whats the equivalent of CompletableFuture.anyOf(...)?
  // is this how we do it? if so how costly is this?
  select<Unit> {
     deffered1.onAwait {}
     deffered2.onAwait {}