Suspending

class Suspending<S : Any>(val creation: Creation, val blocking: Boolean, val onDeleted: Boolean, val decide: suspend DecideScope.(S, Any) -> Decision, val produces: Set<Class<*>>? = null) : 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, onDeleted: Boolean, decide: suspend DecideScope.(S, Any) -> Decision, produces: Set<Class<*>>? = null)
constructor(creation: Creation, blocking: Boolean, decide: suspend DecideScope.(S, Any) -> Decision)
constructor(creation: Creation, 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.