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
Name | Type | Description |
---|---|---|
properties? | IDoBackoff | Properties to set |
Returns
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
backoffDuration
• Optional
backoffDuration: null
| IDuration
DoBackoff backoffDuration.
Implementation of
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
Name | Type | Description |
---|---|---|
properties? | IDoBackoff | Properties to set |
Returns
DoBackoff instance
decode
▸ decode(reader
, length?
): DoBackoff
Decodes a DoBackoff message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
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
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
Name | Type | Description |
---|---|---|
message | IDoBackoff | DoBackoff message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
message | IDoBackoff | DoBackoff message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
object | Object | Plain object |
Returns
DoBackoff
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?
): string
Gets the default type url for DoBackoff
Parameters
Name | Type | Description |
---|---|---|
typeUrlPrefix? | string | your 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
Name | Type | Description |
---|---|---|
message | DoBackoff | DoBackoff |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object