Package-level declarations

Types

Link copied to clipboard
class Platform

Identity of the host platform: its name, osVersion, deviceModel, and family. Read it from Platform.current.

Link copied to clipboard

Coarse platform family used for when branching in shared code.

Link copied to clipboard
class Progress(fraction: Float?, val phase: String? = null)

An immutable snapshot of an operation's progress: a fraction and an optional phase label.

Link copied to clipboard
interface ProgressFuture<out T> : Deferred<T>

A Deferred that also exposes live progress.

Link copied to clipboard
interface ProgressScope : CoroutineScope

The receiver scope of an asyncWithProgress block: a CoroutineScope that can report progress and divide the remaining bar into sequential slices.

Link copied to clipboard
actual class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

actual class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

expect class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

actual class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

actual class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

actual class WeakRef<T : Any>(referred: T)

A weak reference to T. Holds its referent without preventing garbage collection.

Link copied to clipboard
class WebWorker

A Web Worker that runs a self-contained JavaScript job off the main thread on Kotlin/JS.

class WebWorker

A Web Worker that runs a self-contained JavaScript job off the main thread on Kotlin/Wasm (wasmJs).

Link copied to clipboard

Thrown when a WebWorker job throws, the worker script fails to load (e.g. a syntax error in jobJs), or the worker is closed mid-call.

Thrown when a WebWorker job throws, the worker script fails to load (e.g. a syntax error in jobJs), or the worker is closed mid-call.

Properties

Link copied to clipboard
actual val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

actual val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

expect val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

actual val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

actual val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

actual val ioDispatcher: CoroutineDispatcher

The CoroutineDispatcher for blocking and IO-bound work on the current target.

Functions

Link copied to clipboard
fun <T> CoroutineScope.asyncWithProgress(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend ProgressScope.() -> T): ProgressFuture<T>

Starts a coroutine like async and returns a ProgressFuture that reports its progress.

Link copied to clipboard
actual fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

actual fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

expect fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

actual fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

actual fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

actual fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the CoroutineDispatcher that ioDispatcher resolves to on the web targets (js, wasmJs).

Link copied to clipboard
suspend fun runInWorker(jobJs: String, payload: String): String

Builds a worker, runs payload through jobJs, and then closes the worker.

suspend fun runInWorker(jobJs: String, payload: String): String

Builds a worker, runs payload through jobJs, and then closes the worker.

Link copied to clipboard
fun <T> Deferred<T>.withProgress(progress: StateFlow<Progress>): ProgressFuture<T>

Adapts an existing Deferred and an external progress StateFlow into a ProgressFuture.