Skip to main content

Class: NexusHandler

v1.Callback.NexusHandler

NexusHandler callbacks are requests to invoke a specific shape of Nexus operation on a Temporal worker. The specified Nexus operation must have the following:

  • Input: temporal.api.notificationservice.v1.OnCompleteRequest
  • Output: temporal.api.notificationservice.v1.OnCompleteResponse

The targeted Nexus service must be registered within the same namespace as the source operation the callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks are strictly caller-side.)

NexusHandler callbacks are only supported for certain types of operations, e.g. standalone Nexus operations. Attempting to attach a Worker callback for an unsupported operation will result in an INVALID_ARGUMENT error from the server.

Properties

operation

operation: string

Target operation, e.g. "DeliverAsWebhook".


service

service: string

Target Nexus service, e.g. "HTTPAdapter".


sourceContext

Optional sourceContext: null | $Properties

Arbitrary user-supplied data from the source operation's callsite. (As applicable, not all operations support attaching context data.)

There are restrictions on the maxium payload size a single callback can carry, as well as the total sum of all source context payloads attached to an execution. See dynamic configuration: "callback.nexusHandler.sourceContext.maxSize", "callback.nexusHandler.sourceContext.aggregateMaxSize".


taskQueueName

taskQueueName: string

Nexus task queue the Temporal worker is listening on.

NOTE: This is not a temporal.api.taskqueue.v1.TaskQueue to avoid a circular dependency.

Methods

toJSON

toJSON(): Object

Converts this NexusHandler to JSON.

Returns

Object

JSON object


create

create(properties?): NexusHandler & $Properties

Creates a new NexusHandler instance using the specified properties.

Parameters

NameTypeDescription
properties?$PropertiesProperties to set

Returns

NexusHandler & $Properties

NexusHandler instance

create(properties?): NexusHandler

Parameters

NameType
properties?$Properties

Returns

NexusHandler


decode

decode(reader, length?): NexusHandler & $Properties

Decodes a NexusHandler message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

NexusHandler & $Properties

NexusHandler

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): NexusHandler & $Properties

Decodes a NexusHandler message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

NexusHandler & $Properties

NexusHandler

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified NexusHandler message. Does not implicitly temporal.api.common.v1.Callback.NexusHandler.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesNexusHandler message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified NexusHandler message, length delimited. Does not implicitly temporal.api.common.v1.Callback.NexusHandler.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesNexusHandler message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): NexusHandler

Creates a NexusHandler message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

NexusHandler

NexusHandler


toObject

toObject(message, options?): Object

Creates a plain object from a NexusHandler message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageNexusHandlerNexusHandler
options?IConversionOptionsConversion options

Returns

Object

Plain object