Class: 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
| Name | Type | Description |
|---|---|---|
properties? | $Properties | Properties to set |
Returns
NexusHandler instance
▸ create(properties?): NexusHandler
Parameters
| Name | Type |
|---|---|
properties? | $Properties |
Returns
decode
▸ decode(reader, length?): NexusHandler & $Properties
Decodes a NexusHandler message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
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
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
| Name | Type | Description |
|---|---|---|
message | $Properties | NexusHandler message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
message | $Properties | NexusHandler message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
NexusHandler
toObject
▸ toObject(message, options?): Object
Creates a plain object from a NexusHandler message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | NexusHandler | NexusHandler |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object