MosaicImpl

open class MosaicImpl(val canvas: Canvas, dispatcher: CoroutineDispatcher = Dispatchers.Default) : Mosaic, CoroutineScope(source)

Request-scoped Tile execution, caching, and batching, with optional execution observation.

Parameters

canvas

Dependency bindings and immutable runtime configuration.

dispatcher

Dispatcher for all executions, whether observed or unobserved.

Constructors

Link copied to clipboard
constructor(canvas: Canvas, dispatcher: CoroutineDispatcher = Dispatchers.Default)

Properties

Link copied to clipboard
open override val canvas: Canvas
Link copied to clipboard

Functions

Link copied to clipboard
open override fun <V> composeAsync(tile: Tile<V>): Deferred<V>

Retrieve the value of a Tile wrapped in a deferred for awaiting later

open override fun <K : Any, V> composeAsync(tile: MultiTile<K, V>, keys: Collection<K>): Map<K, Deferred<V>>

Retrieve the value of a MultiTile wrapped in a deferred for awaiting later

Inherited functions

Link copied to clipboard
open suspend fun <V> compose(tile: Tile<V>): V

Await the value of a Tile

open suspend fun <K : Any, V> compose(tile: MultiTile<K, V>, key: K): V

Await a single value from a MultiTile

open suspend fun <K : Any, V> compose(tile: MultiTile<K, V>, keys: Collection<K>): Map<K, V>

Await the value of a MultiTile

Link copied to clipboard
open fun <K : Any, V> composeAsync(tile: MultiTile<K, V>, key: K): Deferred<V>

Retrieve a single value from a MultiTile wrapped in a deferred for awaiting later

Link copied to clipboard
inline fun <T : Any> Mosaic.source(qualifier: String? = null): T

Retrieves a dependency from the canvas using reified type parameters.

fun <T : Any> Mosaic.source(key: CanvasKey<T>): T

Retrieves a dependency from the canvas using a CanvasKey.

Link copied to clipboard
inline fun <T : Any> Mosaic.sourceOr(qualifier: String? = null): T?

Retrieves a dependency from the canvas using reified type parameters, returning null if not found.

fun <T : Any> Mosaic.sourceOr(key: CanvasKey<T>): T?

Retrieves a dependency from the canvas using a CanvasKey, returning null if not found.