Package-level declarations

Types

Link copied to clipboard
expect class AsyncExecutor(maxConcurrent: Int) : Disposable
actual class AsyncExecutor(val maxConcurrent: Int) : Disposable
actual class AsyncExecutor(val maxConcurrent: Int) : Disposable
Link copied to clipboard
expect class AsyncResult<T>
actual class AsyncResult<T>
actual class AsyncResult<T>
Link copied to clipboard
class AsyncThreadDispatcher(val executor: AsyncExecutor, val threads: Int = -1) : CoroutineDispatcher, KtDispatcher, Disposable

A CoroutineDispatcher that wraps around an AsyncExecutor instance (executor) to execute tasks asynchronously.

Link copied to clipboard
interface KtDispatcher : CoroutineContext, Delay

The base interface of CoroutineContext for dispatchers.

Link copied to clipboard
object KtScope : CoroutineScope

The main LittleKt coroutine scope. Executes tasks on the main rendering thread. See MainDispatcher

Link copied to clipboard

Executes tasks on the main rendering threads. See RenderingThreadDispatcher

Link copied to clipboard
sealed class RenderingThreadDispatcher : MainCoroutineDispatcher, KtDispatcher

A CoroutineDispatcher that wraps around a Context to execute tasks on main rendering thread.

Functions

Link copied to clipboard
expect fun CoroutineScope.isOnRenderingThread(): Boolean

Returns true if the coroutine was launched from the rendering thread dispatcher.

actual fun CoroutineScope.isOnRenderingThread(): Boolean
actual fun CoroutineScope.isOnRenderingThread(): Boolean
Link copied to clipboard

Creates a new AsyncThreadDispatcher wrapping around an AsyncExecutor with the chosen amount of threads to execute tasks asynchronously outside of the main rendering thread.

Link copied to clipboard

Creates a new AsyncThreadDispatcher wrapping around an AsyncExecutor with a single thread to execute tasks asynchronously outside of the main rendering thread.

Link copied to clipboard
suspend fun <T> onRenderingThread(block: suspend CoroutineScope.() -> T): T

Suspends the coroutine to execute the defined block on the main rendering thread and return its result.

Properties

Link copied to clipboard
val Dispatchers.KT: MainDispatcher

THe main LittleKt coroutine dispatcher. Executes tasks on the main rendering thread. See MainDispatcher