Skip to main content

Class: DoBackoff

coresdk.activity_result.DoBackoff

Issued when a local activity needs to retry but also wants to back off more than would be reasonable to WFT heartbeat for. Lang is expected to schedule a timer for the duration and then start a local activity of the same type & same inputs with the provided attempt number after the timer has elapsed.

This exists because Core does not have a concept of starting commands by itself, they originate from lang. So expecting lang to start the timer / next pass of the activity fits more smoothly.

Implements

Constructors

constructor

new DoBackoff(properties?): DoBackoff

Constructs a new DoBackoff.

Parameters

NameTypeDescription
properties?IDoBackoffProperties to set

Returns

DoBackoff

Properties

attempt

attempt: number

The attempt number that lang should provide when scheduling the retry. If the LA failed on attempt 4 and we told lang to back off with a timer, this number will be 5.

Implementation of

IDoBackoff.attempt


backoffDuration

Optional backoffDuration: null | IDuration

DoBackoff backoffDuration.

Implementation of

IDoBackoff.backoffDuration


originalScheduleTime

Optional originalScheduleTime: null | ITimestamp

The time the first attempt of this local activity was scheduled. Must be passed with attempt to the retry LA.

Implementation of

IDoBackoff.originalScheduleTime

Methods

toJSON

toJSON(): Object

Converts this DoBackoff to JSON.

Returns

Object

JSON object


create

create(properties?): DoBackoff

Creates a new DoBackoff instance using the specified properties.

Parameters

NameTypeDescription
properties?IDoBackoffProperties to set

Returns

DoBackoff

DoBackoff instance


decode

decode(reader, length?): DoBackoff

Decodes a DoBackoff message from the specified reader or buffer.

Parameters

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

Returns

DoBackoff

DoBackoff

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): DoBackoff

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

DoBackoff

DoBackoff

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

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified DoBackoff message, length delimited. Does not implicitly coresdk.activity_result.DoBackoff.verify|verify messages.

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): DoBackoff

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

DoBackoff

DoBackoff


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for DoBackoff

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 DoBackoff message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageDoBackoffDoBackoff
options?IConversionOptionsConversion options

Returns

Object

Plain object