<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><ahref="await-first-with-deferred.html">T</a><spanclass="token operator">></span><ahref="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html">Iterable</a><spanclass="token operator"><</span><spandata-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><spanclass="token operator"><</span><ahref="await-first-with-deferred.html">T</a><spanclass="token operator">></span><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="await-first-with-deferred.html"><spanclass="token function">awaitFirstWithDeferred</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">scope<spanclass="token operator">: </span><spandata-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><spanclass="token punctuation">, </span></span><spanclass="parameter ">cancelOnResult<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><spanclass="token operator"> = </span><spanclass="token boolean">true</span></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html">Pair</a><spanclass="token operator"><</span><spandata-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><spanclass="token operator"><</span><ahref="await-first-with-deferred.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">, </span><ahref="await-first-with-deferred.html">T</a><spanclass="token operator">></span><spanclass="clearfix"><spanclass="floating-right">(<ahref="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/AwaitFirst.kt#L12">source</a>)</span></span></div><pclass="paragraph">Trying to <spandata-unresolved-link="kotlinx.coroutines/Deferred/await/#/PointingToDeclaration/">Deferred.await</span> on all <spandata-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">this</span>s. The first <spandata-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span> completed its work will interrupt all others awaits and, if <ahref="await-first-with-deferred.html">cancelOnResult</a> passed as true (<strong>by default</strong>), will also cancel all the others <spandata-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span>s</p><h4class="">Parameters</h4><divclass="table"><divclass="table-row"data-filterable-current=":micro_utils.dokka:dokkaHtml/commonMain"data-filterable-set=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="main-subrow keyValue "><divclass=""><spanclass="inline-flex"><div><u><span><span>scope</span></span></u></div></span></div><div><divclass="title"><pclass="paragraph">Will be used to create <ahref="-linked-supervisor-scope.html">CoroutineScope.LinkedSupervisorScope</a> and launch joining of all <spandata-unresolved-link="kotlinx.coroutines/Job///PointingToDeclaration/">Job</span>s in it</p></div></div></div></div></div></div></div>