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.

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: null | $Properties

DoBackoff backoffDuration.


originalScheduleTime

Optional originalScheduleTime: null | $Properties

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

create(properties?): DoBackoff & $Properties

Creates a new DoBackoff instance using the specified properties.

Parameters

NameTypeDescription
properties?$PropertiesProperties to set

Returns

DoBackoff & $Properties

DoBackoff instance

create(properties?): DoBackoff

Parameters

NameType
properties?$Properties

Returns

DoBackoff


decode

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

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 & $Properties

DoBackoff

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): DoBackoff & $Properties

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader 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

encode(message, writer?): Writer

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

Parameters

NameTypeDescription
message$PropertiesDoBackoff 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
message$PropertiesDoBackoff 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


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