MimiFetchedProcessingParameter

MimiFetchedProcessingParameter

A ProcessingParameter whose value is derived from an asynchronously "fetched" data source.

Important: This interface is not stable for inheritance, as new methods may be added, but is stable for use.

Since

5.0.0

Parameters

T

The parameter value type

Properties

Link copied to clipboard

Defines how requests to update the ProcessingParameter value are performed.

Link copied to clipboard
abstract val value: T

The current value of the ProcessingParameter - it is the most recent successfully applied value.

Functions

Link copied to clipboard
abstract fun addApplicator(canApply: (value: T) -> Boolean, apply: suspend (value: T) -> Unit, applyTimeoutMillis: Long): MimiParameterApplicator

Adds an out-of-date MimiParameterApplicator to the ProcessingParameter.

abstract suspend fun addApplicator(value: T, canApply: (value: T) -> Boolean, apply: suspend (value: T) -> Unit, applyTimeoutMillis: Long): Pair<MimiParameterApplicator, ProcessingParameterResult>

Adds an already up-to-date MimiParameterApplicator to the ProcessingParameter and triggers a call to attempt to update all other MimiParameterApplicator with that value.

Link copied to clipboard
abstract suspend fun apply(value: T): ProcessingParameterResult

Apply

Link copied to clipboard
abstract suspend fun fetch(): ProcessingParameterResult

Triggers the asynchronous updating of the ProcessingParameter value from an asynchronous data source.

Link copied to clipboard
abstract suspend fun observe(tag: String? = null, fetching: FetchingHandler<T>? = null, applying: ApplyingHandler<T>? = null, failed: FailedHandler<T>? = null, ready: ReadyHandler<T>? = null)

Observe Receives updates indicating the current state of the MimiFetchedProcessingParameter.

Link copied to clipboard
abstract suspend fun synchronize(): ProcessingParameterResult

Synchronize