Package-level declarations

Types

Link copied to clipboard
interface Mosaic

Per-request context used to execute tiles and access dependencies.

Link copied to clipboard
open class MosaicImpl(val canvas: Canvas, dispatcher: CoroutineDispatcher = Dispatchers.Default) : Mosaic, CoroutineScope

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

Link copied to clipboard
class MultiTile<K : Any, V>(block: suspend Mosaic.(Set<K>) -> Map<K, V>)

Representation of a multi-value tile in Mosaic.

Link copied to clipboard
class Tile<T>(block: suspend Mosaic.() -> T)

Representation of a single-value tile in Mosaic.

Functions

Link copied to clipboard
fun <K : Any, V> chunkedMultiTile(batchSize: Int, fetch: suspend Mosaic.(List<K>) -> Map<K, V>): MultiTile<K, V>

Creates a MultiTile that splits incoming keys into batches of batchSize and merges the results from fetch.

Link copied to clipboard
fun <K : Any, V> multiTile(block: suspend Mosaic.(Set<K>) -> Map<K, V>): MultiTile<K, V>

Creates a multi-value tile using the DSL.

Link copied to clipboard
fun <K : Any, V> perKeyTile(fetch: suspend Mosaic.(K) -> V): MultiTile<K, V>

Creates a MultiTile from a per-key fetch function.

Link copied to clipboard
fun <T> singleTile(block: suspend Mosaic.() -> T): Tile<T>

Creates a single-value tile using the DSL.

Inherited functions

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.