DoWithFirstBuilder

class DoWithFirstBuilder<T>(scope: CoroutineScope)(source)

A builder for creating multiple deferred computations that can be executed, with only the first completing one being used. This is useful for race conditions where you want the result of whichever computation finishes first.

Parameters

scope

The CoroutineScope in which to create the deferred computations

Type Parameters

T

The type of values produced by the deferred computations

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope)

Functions

Link copied to clipboard
fun add(block: suspend CoroutineScope.() -> T)
Link copied to clipboard
fun build(): List<Deferred<T>>
Link copied to clipboard
fun include(block: suspend CoroutineScope.() -> T)
Link copied to clipboard
operator fun plus(block: suspend CoroutineScope.() -> T)