update ktlint rules
This commit is contained in:
@@ -10,26 +10,26 @@ import kotlinx.coroutines.launch
|
||||
* The stream contains a list of all actions yet to be executed.
|
||||
*/
|
||||
interface CommandStream<C : Command> {
|
||||
/**
|
||||
* A class to implement success/failed action.
|
||||
*/
|
||||
interface ComputeStatus {
|
||||
suspend fun ack()
|
||||
/**
|
||||
* A class to implement success/failed action.
|
||||
*/
|
||||
interface ComputeStatus {
|
||||
suspend fun ack()
|
||||
|
||||
suspend fun nack()
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply an action to all command income in the stream.
|
||||
*/
|
||||
suspend fun process(action: CommandBlock<C>)
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
fun blockAndProcess(action: CommandBlock<C>) {
|
||||
GlobalScope.launch {
|
||||
process(action)
|
||||
}
|
||||
suspend fun nack()
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply an action to all command income in the stream.
|
||||
*/
|
||||
suspend fun process(action: CommandBlock<C>)
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
fun blockAndProcess(action: CommandBlock<C>) {
|
||||
GlobalScope.launch {
|
||||
process(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typealias CommandBlock<C> = suspend CommandStream.ComputeStatus.(C) -> Unit
|
||||
|
||||
Reference in New Issue
Block a user