Skip to main content

Class: 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.

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.


backoffDuration?​

optional backoffDuration?: $Properties | null

DoBackoff backoffDuration.


originalScheduleTime?​

optional originalScheduleTime?: $Properties | null

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

Methods​

toJSON()​

toJSON(): object

Converts this DoBackoff to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): DoBackoff & $Properties

Creates a new DoBackoff instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

DoBackoff & $Properties

DoBackoff instance

Call Signature​

static create(properties?): DoBackoff

Creates a new DoBackoff instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

DoBackoff

DoBackoff instance


decode()​

static decode(reader, length?): DoBackoff & $Properties

Decodes a DoBackoff 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​

DoBackoff & $Properties

DoBackoff

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): DoBackoff & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

DoBackoff & $Properties

DoBackoff

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

Parameters​

message​

$Properties

DoBackoff message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

DoBackoff message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): DoBackoff

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

DoBackoff

DoBackoff


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

DoBackoff

DoBackoff

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object