Skip to main content

Class: NexusTask

Represents a NexusTask.

Properties​

cancelTask?​

optional cancelTask?: $Properties | null

A request by Core to notify an in-progress operation handler that it should cancel. This is distinct from a CancelOperationRequest from the server, which results from the user requesting the cancellation of an operation. Handling this variant should result in something like cancelling a cancellation token given to the user's operation handler.

These do not count as a separate task for the purposes of completing all issued tasks, but rather count as a sort of modification to the already-issued task which is being cancelled.

EX: Core knows the nexus operation has timed out, and it does not make sense for the user's operation handler to continue doing work.


endpoint​

endpoint: string

The endpoint this request was addressed to. Extracted from the request for convenient access. Only set when variant is task.


requestDeadline?​

optional requestDeadline?: $Properties | null

The deadline for this request, parsed from the "Request-Timeout" header. Only set when variant is task and the header was present with a valid value. Represented as an absolute timestamp.


task?​

optional task?: $Properties | null

A nexus task from server


variant?​

optional variant?: "task" | "cancelTask"

NexusTask variant.

Methods​

toJSON()​

toJSON(): object

Converts this NexusTask to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): NexusTask & $Shape

Creates a new NexusTask instance using the specified properties.

Parameters​
properties?​

$Shape

Properties to set

Returns​

NexusTask & $Shape

NexusTask instance

Call Signature​

static create(properties?): NexusTask

Creates a new NexusTask instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

NexusTask

NexusTask instance


decode()​

static decode(reader, length?): NexusTask & $Shape

Decodes a NexusTask message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

NexusTask & $Shape

NexusTask

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): NexusTask & $Shape

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

NexusTask & $Shape

NexusTask

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified NexusTask message. Does not implicitly coresdk.nexus.NexusTask.verify|verify messages.

Parameters​

message​

$Properties

NexusTask message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified NexusTask message, length delimited. Does not implicitly coresdk.nexus.NexusTask.verify|verify messages.

Parameters​

message​

$Properties

NexusTask message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): NexusTask

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

NexusTask

NexusTask


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

NexusTask

NexusTask

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object