InProcessCommandClient

class InProcessCommandClient @InternalWowApi constructor(gateway: CommandGateway, caller: Caller = Caller.ANONYMOUS) : CommandClient

The CommandClient of a service's own node: each command goes to gateway as the object it is (ServerCommandRequest.of), sent as caller. An aggregate the node serves runs it in process, never encoded; one of a peer context known from its contract goes to that context's command topic, answering at ACCEPTED or at its COMMITTED. The gateway admits it as any request: the caller is authorized, the command validated, its identity decided.

A request without a type goes to the one aggregate type that takes its command's class: one the node decides or mounts it on, or one a peer context's contract lists it for (CommandGateway.aggregatesOf). Its tenant is the caller's, unless it targets another (targetTenantOf).

A failure is the problem the edge would answer it with: its status, retry and Retry-After as the error catalog declares them for its code (FrameworkErrors.problemOf).

Constructors

Link copied to clipboard
constructor(gateway: CommandGateway, caller: Caller = Caller.ANONYMOUS)

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun of(caller: Caller): CommandClient
Link copied to clipboard
open suspend override fun send(request: CommandRequest<*>): CommandResult
Link copied to clipboard
open override fun stream(request: CommandRequest<*>): Flow<CommandResult>
Link copied to clipboard
open suspend override fun wait(request: CommandRequest<*>): CommandResult