All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.pro.respawn.flowmvi.api.Recoverable.kt Maven / Gradle / Ivy

Go to download

A Kotlin Multiplatform MVI library based on plugins that is simple, fast, powerful & flexible

There is a newer version: 3.0.0
Show newest version
package pro.respawn.flowmvi.api

import kotlin.coroutines.CoroutineContext

/**
 * An entity that can [recover] from exceptions happening during its lifecycle. Most often, a [Store]
 */
@Suppress("FUN_INTERFACE_WITH_SUSPEND_FUNCTION") // https://youtrack.jetbrains.com/issue/KTIJ-7642
@DelicateStoreApi
public fun interface Recoverable : CoroutineContext.Element {

    override val key: CoroutineContext.Key<*> get() = Recoverable

    /**
     * Recover from an exception in the given context.
     */
    public suspend fun PipelineContext.recover(e: Exception)

    @DelicateStoreApi
    public companion object : CoroutineContext.Key>
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy