Interface: StreamedCommandContext

akkaserverless.Action. StreamedCommandContext

Context for a streamed action command.

Extends

Members


metadata :module:akkaserverless.Metadata

Type:
Inherited From:
Overrides:

Methods


cancel()

Cancel the incoming stream of messages.

Inherited From:

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:
Overrides:

end()

Terminate the outgoing stream of messages.

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:
Overrides:
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.

Inherited From:
Overrides:

on(eventType, callback)

Register an event handler.

Parameters:
Name Type Description
eventType string

The type of the event.

callback function

The callback to handle the event.

Inherited From:
Overrides:

reply(reply)

Send a reply

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

The reply to send

Inherited From:

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.

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

write(message [, metadata])

Write a message.

Parameters:
Name Type Argument Description
message Object

The protobuf message to write.

metadata module:akkaserverless.Metadata <optional>

The metadata associated with the message.

Inherited From:
Overrides:

Events


cancelled

A cancelled event.

Inherited From:

data

A data event.

Emitted when a new message arrives.

Type: Object
Inherited From:

end

A stream end event.

Emitted when the input stream terminates.

If a callback is registered and that returns a Reply, then that is returned as a response from the action

Inherited From: