Interface: CommandContext

akkaserverless. CommandContext

Context for a command.

Extends

Members


metadata :module:akkaserverless.Metadata

Type:
Inherited From:

Methods


effect(method, message [, synchronous] [, metadata] [, internalCall])

DEPRECATED. Emit an effect after processing this command.

Parameters:
Name Type Argument Description
method any

The entity service method to invoke.

message object

The message to send to that service.

synchronous boolean <optional>

Whether the effect should be execute synchronously or not.

metadata module:akkaserverless.Metadata <optional>

Metadata to send with the effect.

internalCall boolean <optional>

For internal calls to this deprecated function.

Inherited From:

fail(msg)

Fail handling this command.

An alternative to using this is to return a failed Reply created with 'ReplyFactory.failed'.

Parameters:
Name Type Description
msg string

The failure message.

Inherited From:
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.


forward(method, message [, metadata] [, internalCall])

DEPRECATED. Forward this command to another service component call, use 'ReplyFactory.forward' instead.

Parameters:
Name Type Argument Description
method any

The service component method to invoke.

message object

The message to send to that service component.

metadata module:akkaserverless.Metadata <optional>

Metadata to send with the forward.

internalCall boolean <optional>

For internal calls to this deprecated function.


thenForward(method, message, metadata)

DEPRECATED. Forward this command to another service component call.

Parameters:
Name Type Description
method any

The service component method to invoke.

message object

The message to send to that service component.

metadata module:akkaserverless.Metadata

Metadata to send with the forward.

Deprecated:
  • Since version 0.7. Will be deleted in version 0.8. Use 'forward' instead.