Ir al contenido

Async Result Discarded (ARCH8020)

Esta página aún no está disponible en tu idioma.

Key kotlin.async.async-result-discarded · Severity warning · Category async

Flags async { } whose Deferred is never awaited or stored - the work runs but its result and failure are lost; that is what launch is for.

scope.async { sync() }
scope.launch { sync() }
// or: val d = scope.async { load() }; d.await()

Use launch for fire-and-forget work, or await the Deferred.