CoroutineCommand

class CoroutineCommand(requirements: Set<Any> = emptySet(), priority: Int = 0, interruptedBehavior: InterruptedBehavior = InterruptedBehavior.END, conflictBehavior: ConflictBehavior = ConflictBehavior.OVERRIDE, blockedBehavior: BlockedBehavior = BlockedBehavior.CANCEL, body: suspend CommandScope.() -> Unit) : Command

A Command whose behavior is written as a sequential coroutine instead of as a start/execute/done state machine.

The body is advanced one slice per execute call and the command is done once the body returns. Interrupting the command resumes the body with a CancellationException, so finally blocks run and inline commands started with CommandScope.await are ended.

Constructors

Link copied to clipboard
constructor(requirements: Set<Any> = emptySet(), priority: Int = 0, interruptedBehavior: InterruptedBehavior = InterruptedBehavior.END, conflictBehavior: ConflictBehavior = ConflictBehavior.OVERRIDE, blockedBehavior: BlockedBehavior = BlockedBehavior.CANCEL, body: suspend CommandScope.() -> Unit)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun blockedBehavior(): BlockedBehavior
Link copied to clipboard
open fun cancel()
Link copied to clipboard
open override fun conflictBehavior(): ConflictBehavior
Link copied to clipboard
open override fun done(): Boolean
Link copied to clipboard
open override fun end(endCondition: EndCondition)
Link copied to clipboard
open override fun execute()
Link copied to clipboard
open override fun interruptedBehavior(): InterruptedBehavior
Link copied to clipboard
open override fun priority(): Int
Link copied to clipboard
open fun proxy(): CommandBuilder?
Link copied to clipboard
open fun raceWith(vararg commands: Command?): CommandBuilder?
Link copied to clipboard
open override fun requirements(): Set<Any>
Link copied to clipboard
open fun schedule()
Link copied to clipboard
open override fun start()
Link copied to clipboard
open fun then(vararg commands: Command?): CommandBuilder?
Link copied to clipboard
open fun unless(condition: BooleanSupplier?): CommandBuilder?
Link copied to clipboard
open fun until(condition: BooleanSupplier?): CommandBuilder?
Link copied to clipboard
open fun with(vararg commands: Command?): CommandBuilder?