RetryConfig

data class RetryConfig(val maxAttempts: Int = DEFAULT_MAX_ATTEMPTS, val initialDelay: Duration = DEFAULT_INITIAL_DELAY, val maxDelay: Duration = DEFAULT_MAX_DELAY, val backoffFactor: Double = DEFAULT_BACKOFF_FACTOR, val jitter: Double = DEFAULT_JITTER, val exceptions: List<String>? = null, val exceptionClasses: List<KClass<out Exception>>? = null)

How a node is retried when it raises.

Constructors

Link copied to clipboard
constructor(maxAttempts: Int = DEFAULT_MAX_ATTEMPTS, initialDelay: Duration = DEFAULT_INITIAL_DELAY, maxDelay: Duration = DEFAULT_MAX_DELAY, backoffFactor: Double = DEFAULT_BACKOFF_FACTOR, jitter: Double = DEFAULT_JITTER, exceptions: List<String>? = null, exceptionClasses: List<KClass<out Exception>>? = null)

Types

Link copied to clipboard
class Builder

Fluent builder for RetryConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Multiplier applied to the delay after each attempt.

Link copied to clipboard

Failure types to retry on, each also matching its subclasses. A failure is retried when it matches this list or exceptions, and any failure is retried when both are null. A WorkflowConfigurationException, or the WorkflowInvariantException of a replay that timed out, is never retried, even when matched by a listed class.

Link copied to clipboard

Simple class names of failures to retry on, such as "NodeTimeoutException", matched exactly with no subclass matching. A failure is retried when it matches this list or exceptionClasses, and any failure is retried when both are null. A WorkflowConfigurationException, or the WorkflowInvariantException of a replay that timed out, is never retried, even when listed.

Link copied to clipboard

Delay before the first retry.

Link copied to clipboard

Randomness factor, not a duration: the delay is spread over delay * (1 +/- jitter). Zero removes randomness.

Link copied to clipboard

Attempts including the first, so 0 or 1 means no retry.

Link copied to clipboard

Ceiling on any single delay.

Functions

Link copied to clipboard

Returns exceptionClasses as Java classes, or null when unset, for Java callers.

Link copied to clipboard

Returns initialDelay in whole milliseconds. Java cannot read it (mangled).

Link copied to clipboard

Returns maxDelay in whole milliseconds. Java cannot read it (mangled).

Link copied to clipboard

Returns a Builder initialized with this instance's properties, primarily for Java callers. Prefer it over copy from Java: copy takes every property positionally, so its signature changes whenever a property is added.