You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/dsls/DSL-Reactor.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2306,8 +2306,9 @@ end
2306
2306
|------|------|---------|------|
2307
2307
|[`description`](#reactor-step-description){: #reactor-step-description } |`String.t`|| An optional description for the step. |
2308
2308
|[`run`](#reactor-step-run){: #reactor-step-run } |`(any -> any) \| mfa \| (any, any -> any) \| mfa`|| Provide an anonymous function which implements a `run/1-2` callback. Cannot be provided at the same time as the `impl` argument. |
2309
-
|[`undo`](#reactor-step-undo){: #reactor-step-undo } |`(any -> any) \| mfa \| (any, any -> any) \| mfa \| (any, any, any -> any) \| mfa`|| Provide an anonymous function which implements a `undo/1-3` callback. Cannot be provided at the same time as the `impl` argument. |
2310
-
|[`compensate`](#reactor-step-compensate){: #reactor-step-compensate } |`(any -> any) \| mfa \| (any, any -> any) \| mfa \| (any, any, any -> any) \| mfa`|| Provide an anonymous function which implements a `compensate/1-3` callback. Cannot be provided at the same time as the `impl` argument. |
2309
+
|[`undo`](#reactor-step-undo){: #reactor-step-undo } |`(any -> any) \| mfa \| (any, any -> any) \| mfa \| (any, any, any -> any) \| mfa`|| Provide an anonymous function which implements a `undo/1..3` callback. Cannot be provided at the same time as the `impl` argument. |
2310
+
|[`compensate`](#reactor-step-compensate){: #reactor-step-compensate } |`(any -> any) \| mfa \| (any, any -> any) \| mfa \| (any, any, any -> any) \| mfa`|| Provide an anonymous function which implements a `compensate/1..3` callback. Cannot be provided at the same time as the `impl` argument. |
2311
+
|[`backoff`](#reactor-step-backoff){: #reactor-step-backoff } |`(any -> any) \| mfa \| (any, any -> any) \| mfa \| (any, any, any -> any) \| mfa`|| Provide an anonymous function which implements a `backoff/1..3` callback. Cannot be provided at the same time as the `impl` argument. |
2311
2312
|[`max_retries`](#reactor-step-max_retries){: #reactor-step-max_retries } |`:infinity \| non_neg_integer`|`:infinity`| The maximum number of times that the step can be retried before failing. Only used when the result of the `compensate` callback is `:retry`. |
2312
2313
|[`async?`](#reactor-step-async?){: #reactor-step-async? } |`boolean`|`true`| When set to true the step will be executed asynchronously via Reactor's `TaskSupervisor`. |
2313
2314
|[`transform`](#reactor-step-transform){: #reactor-step-transform } |`(any -> any) \| module \| nil`|| An optional transformation function which can be used to modify the entire argument map before it is passed to the step. |
Copy file name to clipboardExpand all lines: documentation/reference/glossary.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,17 +94,25 @@ This glossary defines key terms, concepts, and technical vocabulary used through
94
94
95
95
## Error Handling Concepts
96
96
97
+
**Backoff** - Delay mechanism that adds intelligent waiting periods between retry attempts to prevent overwhelming external services and improve system stability. Backoff delays are minimum delays - actual retry timing may be longer as the executor prioritises processing ready steps before checking for expired backoffs.
98
+
99
+
**Backoff Callback** - Optional `c:Reactor.Step.backoff/4` callback that determines retry delay based on arguments, context, step metadata, and error reason.
100
+
97
101
**Compensation Logic** - Step-level error handling that decides whether to retry, continue with alternative values, or fail.
98
102
99
103
**Error Classification** - Categorisation of errors using splode library into Invalid, Internal, Unknown, and Validation types.
100
104
101
-
**Exponential Backoff** - Retry strategy where delay increases exponentially with each retry attempt.
105
+
**Exponential Backoff** - Retry strategy where delay increases exponentially with each retry attempt (1s, 2s, 4s, 8s...), commonly used for network issues and service overload.
106
+
107
+
**Fixed Backoff** - Retry strategy using consistent delays between attempts, often used for rate limiting when reset intervals are known.
108
+
109
+
**Jittered Backoff** - Backoff strategy that adds randomness to delays to prevent thundering herd problems when multiple clients retry simultaneously.
102
110
103
111
**Max Retries** - Configuration limiting how many times a step can be retried through compensation.
104
112
105
-
**Retry Logic** - Automatic re-execution of failed steps when compensation returns `:retry`.
113
+
**Retry Logic** - Automatic re-execution of failed steps when compensation returns `:retry`, now enhanced with optional backoff delays.
106
114
107
-
**Three-Tier Error Handling** - Reactor's approach using compensation (retry), undo (rollback), and global rollback levels.
115
+
**Three-Tier Error Handling** - Reactor's approach using compensation (retry), backoff (delay), undo (rollback), and global rollback levels.
108
116
109
117
**Undo Stack** - Last-in-first-out collection of successfully completed undoable steps for rollback purposes.
0 commit comments