Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / core / RunAsyncOptions

Type Alias: RunAsyncOptions

type RunAsyncOptions = {
  backoff?:   | {
     delay: number;
     type: "exponential";
   }
     | {
     delay: number;
     type: "constant";
   }
     | {
     type: "none";
   };
  retries?: number;
  retryCondition?: (error) => boolean;
  signal?: AbortSignal;
};

Defined in: packages/sdk/src/core/utils.ts:126

Properties

backoff?

optional backoff: 
  | {
  delay: number;
  type: "exponential";
}
  | {
  delay: number;
  type: "constant";
}
  | {
  type: "none";
};

Defined in: packages/sdk/src/core/utils.ts:142

The backoff strategy to use.

Default

{ type: "none" }

retries?

optional retries: number;

Defined in: packages/sdk/src/core/utils.ts:136

The number of times to retry the function in case of failure.

If omitted, the function won't be retried.


retryCondition()?

optional retryCondition: (error) => boolean;

Defined in: packages/sdk/src/core/utils.ts:155

A function to determine if the function should be retried.

By default, the function will always retry until the number of retries is reached. If the number of retries is not set then this function will be ignored.

Parameters

error

unknown

The error that occurred.

Returns

boolean

True if the function should be retried, false otherwise.


signal?

optional signal: AbortSignal;

Defined in: packages/sdk/src/core/utils.ts:130

The signal to abort the function.