Suspending

class Suspending<S : Any>(val creation: Creation, val blocking: Boolean = false, val onDeleted: Boolean = false, val produces: Set<Class<*>>? = null, val decide: suspend DecideScope.(S, Any) -> Decision) : DecideFunction<S>

A suspending decide function; a blocking one blocks its thread, so the kernel runs it on a virtual thread.

Constructors

Link copied to clipboard
constructor(creation: Creation, blocking: Boolean = false, onDeleted: Boolean = false, produces: Set<Class<*>>? = null, decide: suspend DecideScope.(S, Any) -> Decision)

Properties

Link copied to clipboard
Link copied to clipboard
open override val creation: Creation

Whether the command may, or must, create the aggregate.

Link copied to clipboard
val decide: suspend DecideScope.(S, Any) -> Decision
Link copied to clipboard
open override val onDeleted: Boolean

Whether the command is decided on a deleted aggregate too (@OnCommand(onDeleted = true)), as the kernel decides RestoreAggregate; every other command is refused on one (wow.aggregate.deleted).

Link copied to clipboard
open override val produces: Set<Class<*>>?

The events it may produce, those its return type yields or its produces lists: the kernel fails a command whose decision holds another (UndeclaredEventException). Null when they are unknown, and then not checked.