Options
All
  • Public
  • Public/Protected
  • All
Menu

Context for an event sourced command.

Type Parameters

Hierarchy

  • EntityCommandContext
    • CommandContext

Index

Properties

entityId: string

The id of the entity that the command is for.

commandId: Long

The id of the command.

replyMetadata: Metadata

The metadata to send with a reply.

metadata: Metadata

The metadata associated with the command.

Methods

  • DEPRECATED. Emit an effect after processing this command.

    deprecated

    Use Reply.addEffect instead.

    Parameters

    • method: EffectMethod

      The entity service method to invoke

    • message: Message

      The message to send to that service

    • Optional synchronous: boolean

      Whether the effect should be execute synchronously or not

    • Optional metadata: Metadata

      Metadata to send with the effect

    • Optional internalCall: boolean

      For internal calls to this deprecated function

    Returns void

  • Fail handling this command.

    remarks

    An alternative to using this is to return a failed Reply created with replies.failure.

    throws

    An error that captures the failure message. Note that even if you catch the error thrown by this method, the command will still be failed with the given message.

    Parameters

    • msg: string

      The failure message

    • Optional grpcStatus: GrpcStatus

      The grpcStatus

    Returns void

  • DEPRECATED. Forward this command to another service component call.

    deprecated

    Use replies.forward instead.

    Parameters

    • method: EffectMethod

      The service component method to invoke

    • message: Message

      The message to send to that service component

    • Optional metadata: Metadata

      Metadata to send with the forward

    Returns void

  • DEPRECATED. Forward this command to another service component call.

    deprecated

    Use replies.forward instead.

    Parameters

    • method: EffectMethod

      The service component method to invoke

    • message: Message

      The message to send to that service component

    • Optional metadata: Metadata

      Metadata to send with the forward

    • Optional internalCall: boolean

      For internal calls to this deprecated function

    Returns void

  • emit(event: Events): void
  • Persist an event.

    remarks

    The event won't be persisted until the reply is sent to the proxy, but will be persisted before the reply is sent back to the client.

    Parameters

    • event: Events

      The event to emit

    Returns void

Generated using TypeDoc