AbstractCommandFunction

abstract class AbstractCommandFunction<C : Any>(val commandAggregate: CommandAggregate<C, *>, afterCommandFunctions: List<AfterCommandFunction<C>>) : MessageFunction<C, ServerCommandExchange<*>, Mono<DomainEventStream>>

Abstract base class for command functions that handle command processing with after-command functions.

This class provides the framework for executing commands and their associated after-command functions, combining their results into a domain event stream.

Parameters

afterCommandFunctions

List of after-command functions to execute after the main command.

Type Parameters

C

The type of the command aggregate.

Inheritors

Constructors

Link copied to clipboard
constructor(commandAggregate: CommandAggregate<C, *>, afterCommandFunctions: List<AfterCommandFunction<C>>)

Creates a new AbstractCommandFunction with the specified command aggregate and after functions.

Properties

Link copied to clipboard

The command aggregate instance this function belongs to.

Functions

Link copied to clipboard
open operator override fun invoke(exchange: ServerCommandExchange<*>): Mono<DomainEventStream>

Invokes the command function and returns a domain event stream.

Link copied to clipboard
abstract fun invokeCommand(exchange: ServerCommandExchange<*>): Mono<*>

Invokes the main command logic.