Package-level declarations

Types

Link copied to clipboard
interface Mosaic

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

Link copied to clipboard
class MultiTile<K : Any, 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 retains results from each independent fetch invocation. A failed chunk only fails its unfinished keys; a partial map fails omitted keys with NoSuchElementException while preserving present values, including null for a nullable value type. Successful sibling chunks remain cached. Chunks run concurrently; batchSize limits keys per invocation, not concurrency. Exact chunk membership depends on pending keys and scheduling.

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 a bulk provider. Present map entries succeed, including null for a nullable value type. Omitted requested keys fail individually with NoSuchElementException. A thrown provider failure fails unfinished keys in that physical invocation; successful outcomes remain cached.

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.sourceOrNull(qualifier: String? = null): T?

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

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

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