Class: Reply

akkaserverless.replies. Reply


new Reply()

A return type to allow returning forwards or failures, and attaching effects to messages.

Methods


addEffect(method, message [, synchronous] [, metadata])

Attach the given effect to this reply.

Parameters:
Name Type Argument Default Description
method protobuf.Method

The entity service method to invoke.

message object

The message to send to that service.

synchronous boolean <optional>
false

Whether the effect should be execute synchronously or not, default is false.

metadata module:akkaserverless.Metadata <optional>

Metadata to send with the effect.

Returns:

This reply after adding the effect.

Type
module:akkaserverless.replies.Reply

addEffects(effects)

Attach the given effects to this reply.

Parameters:
Name Type Description
effects Array.<Effect>

One or more service calls to execute as side effects.

Returns:

This reply after adding the effects.

Type
module:akkaserverless.replies.Reply

getEffects()

Returns:

The side effects for this reply.

Type
Array.<module:akkaserverless.replies.Effect>

getFailure()

Returns:

The failure description.

Type
string | undefined

getForward()

Returns:

The forwarding reply.

Type
module:akkaserverless.replies.Reply | undefined

getMessage()

Returns:

the reply message

Type
any

getMetadata()

Returns:

The metadata attached to the reply.

Type
module:akkaserverless.Metadata

getMethod()

Returns:

The protobuf method for a forwarding reply.

Type
protobuf.Method | undefined

isEmpty()

Whether this reply is empty: does not have a message, forward, or failure.

Returns:

Whether the reply is empty.

Type
boolean

setFailure(failure)

Make this a failure reply.

Parameters:
Name Type Description
failure string

The failure description.

Returns:

The updated reply.

Type
module:akkaserverless.replies.Reply

setForward(forward)

Make this a forwarding reply.

Parameters:
Name Type Description
forward module:akkaserverless.replies.Reply

The forward reply.

Returns:

The updated reply.

Type
module:akkaserverless.replies.Reply

setMessage(message)

Set the message for this reply.

Parameters:
Name Type Description
message any

The reply message.

Returns:

The updated reply.

Type
module:akkaserverless.replies.Reply

setMetadata(metadata)

Attach metadata to this reply.

Parameters:
Name Type Description
metadata module:akkaserverless.Metadata | undefined

Metadata to send with the reply.

Returns:

The updated reply.

Type
module:akkaserverless.replies.Reply

setMethod(method)

Set the protobuf method for a forwarding reply.

Parameters:
Name Type Description
method protobuf.Method

The protobuf method.

Returns:

The updated reply.

Type
module:akkaserverless.replies.Reply