Skip to content

Latest commit

 

History

History
221 lines (120 loc) · 3.08 KB

File metadata and controls

221 lines (120 loc) · 3.08 KB

Home > @aws/durable-execution-sdk-js > BatchResult

BatchResult interface

Result of a batch operation (map, parallel, or concurrent execution)

Signature:

export interface BatchResult<TResult>

Properties

Property

Modifiers

Type

Description

all

Array<BatchItem<TResult>>

All items in the batch with their results/errors

completionReason

"ALL_COMPLETED" | "MIN_SUCCESSFUL_REACHED" | "FAILURE_TOLERANCE_EXCEEDED"

Reason why the batch completed

failureCount

number

Number of failed items

hasFailure

boolean

Whether any item in the batch failed

startedCount

number

Number of started but not completed items

status

BatchItemStatus.SUCCEEDED | BatchItemStatus.FAILED

Overall status of the batch (SUCCEEDED if no failures, FAILED otherwise)

successCount

number

Number of successful items

totalCount

number

Total number of items

Methods

Method

Description

failed()

Returns only the items that failed

getErrors()

Returns array of all errors

getResults()

Returns array of all successful results

started()

Returns only the items that are still in progress

succeeded()

Returns only the items that succeeded

throwIfError()

Throws the first error if any item failed