Package-level declarations

Types

Link copied to clipboard

Class holding reference to the Application running Kaluga set applicationContext to your Application so default constructors work with the proper Context

Link copied to clipboard
data class IOSVersion(val major: Int, val minor: Int = 0, val patch: Int = 0) : Comparable<IOSVersion>

Wrapper for the iOS OS Version

Link copied to clipboard
actual data class KalugaThread

The thread of execution

actual data class KalugaThread

The thread of execution

expect class KalugaThread

The thread of execution

actual class KalugaThread

The thread of execution On JavaScript there is only one thread, so everything is the main thread

actual data class KalugaThread

The thread of execution

actual class KalugaThread

The thread of execution. On Kotlin/Wasm there is only one thread, so everything is the main thread.

Properties

Link copied to clipboard

true if called from the main thread.

Link copied to clipboard

Functions

Link copied to clipboard
actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs a new coroutine and blocks the current thread interruptibly until its completion. This function should not be used from a coroutine. It is designed to bridge regular blocking code to libraries that are written in suspending style, to be used in main functions and in tests.

actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs a new coroutine and blocks the current thread interruptibly until its completion. This function should not be used from a coroutine. It is designed to bridge regular blocking code to libraries that are written in suspending style, to be used in main functions and in tests.

expect fun <T> runBlocking(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs a new coroutine and blocks the current thread interruptibly until its completion. This function should not be used from a coroutine. It is designed to bridge regular blocking code to libraries that are written in suspending style, to be used in main functions and in tests.

actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs a new coroutine and blocks the current thread interruptibly until its completion. This function should not be used from a coroutine. It is designed to bridge regular blocking code to libraries that are written in suspending style, to be used in main functions and in tests.

actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs a new coroutine. The JS family (js + wasmJs) is single-threaded and cannot block, so block is launched on GlobalScope and the (not-yet-completed) kotlinx.coroutines.Deferred is returned cast to T — i.e. this does not actually block. Suitable only for fire-and-forget bridging such as com.splendo.kaluga.base.state.KalugaState.peekState; to drive suspending tests use the TestResult-returning runner in test-utils-base instead.

Link copied to clipboard
actual fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread

actual fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread

expect fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread

actual fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread. Since JavaScript does not have any threading, this will just run block

actual fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread

actual fun runOnMain(block: () -> Unit)

Runs the provided block on the main thread. Kotlin/Wasm is single-threaded, so this just runs block.

Link copied to clipboard
actual fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a single thread.

actual fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a single thread.

expect fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a single thread.

actual fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a single thread. Since JavaScript does not have threading support, this will just return Dispatchers.Default

actual fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a single thread.

actual fun singleThreadDispatcher(name: String): CloseableCoroutineDispatcher

Kotlin/Wasm has no threading, so this returns Dispatchers.Default.

Link copied to clipboard
actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

expect fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool. Since JavaScript does not have threading support, this will just return Dispatchers.Default

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Kotlin/Wasm has no threading, so this returns Dispatchers.Default.