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

commonMain.com.zegreatrob.testmints.action.ActionCannon.kt Maven / Gradle / Ivy

There is a newer version: 12.1.17
Show newest version
package com.zegreatrob.testmints.action

import com.zegreatrob.testmints.action.async.SuspendAction

interface ActionCannon {
    suspend fun  fire(action: SuspendAction): R

    companion object {
        operator fun  invoke(dispatcher: D, pipe: ActionPipe = ActionPipe): ActionCannon =
            DispatcherPipeCannon(dispatcher, pipe)
    }
}

data class DispatcherPipeCannon(val dispatcher: D, val pipe: ActionPipe = ActionPipe) : ActionCannon {
    override suspend fun  fire(action: SuspendAction): R = pipe.execute(dispatcher, action)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy