Skip to main content

Class: NexusTask

coresdk.nexus.NexusTask

Represents a NexusTask.

Implements

Constructors

constructor

new NexusTask(properties?): NexusTask

Constructs a new NexusTask.

Parameters

NameTypeDescription
properties?INexusTaskProperties to set

Returns

NexusTask

Properties

cancelTask

Optional cancelTask: null | ICancelNexusTask

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.

Implementation of

INexusTask.cancelTask


task

Optional task: null | IPollNexusTaskQueueResponse

A nexus task from server

Implementation of

INexusTask.task


variant

Optional variant: "task" | "cancelTask"

NexusTask variant.

Methods

toJSON

toJSON(): Object

Converts this NexusTask to JSON.

Returns

Object

JSON object


create

create(properties?): NexusTask

Creates a new NexusTask instance using the specified properties.

Parameters

NameTypeDescription
properties?INexusTaskProperties to set

Returns

NexusTask

NexusTask instance


decode

decode(reader, length?): NexusTask

Decodes a NexusTask message from the specified reader or buffer.

Parameters

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

Returns

NexusTask

NexusTask

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): NexusTask

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

NexusTask

NexusTask

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 NexusTask message. Does not implicitly coresdk.nexus.NexusTask.verify|verify messages.

Parameters

NameTypeDescription
messageINexusTaskNexusTask message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

NameTypeDescription
messageINexusTaskNexusTask message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): NexusTask

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

NexusTask

NexusTask


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for NexusTask

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageNexusTaskNexusTask
options?IConversionOptionsConversion options

Returns

Object

Plain object