Add Comments
This commit is contained in:
@@ -2,6 +2,11 @@ package eventDemo.libs.command
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Represent a Command stream.
|
||||
*
|
||||
* The stream contains a list of all actions yet to be executed.
|
||||
*/
|
||||
interface CommandStream<C : Command> {
|
||||
/**
|
||||
* Send a new [Command] to the queue.
|
||||
@@ -22,7 +27,7 @@ interface CommandStream<C : Command> {
|
||||
}
|
||||
|
||||
/**
|
||||
* A class to implement succes/faild action.
|
||||
* A class to implement success/failed action.
|
||||
*/
|
||||
interface ComputeStatus {
|
||||
fun ack()
|
||||
@@ -30,7 +35,10 @@ interface CommandStream<C : Command> {
|
||||
fun nack()
|
||||
}
|
||||
|
||||
suspend fun process(block: CommandBlock<C>)
|
||||
/**
|
||||
* Apply an action to all command income in the stream.
|
||||
*/
|
||||
suspend fun process(action: CommandBlock<C>)
|
||||
}
|
||||
|
||||
suspend inline fun <reified C : Command> CommandStream<C>.send(vararg command: C) = send(C::class, *command)
|
||||
|
||||
Reference in New Issue
Block a user