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
* Expose all run retry options
* Remove post_init
* Make retry happen instantaneously on errors.
* Fix incorrect try/catch
* Move take_and_send_output inside the do progress loop, and enqueue the restate event always.
* Move take_and_send_output inside the do progress loop, and enqueue the restate event always.
* Format
@@ -40,15 +41,32 @@ class RunOptions(typing.Generic[T]):
40
41
serde: Serde[T] =DefaultSerde()
41
42
"""The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
42
43
See also 'type_hint'."""
43
-
max_attempts: Optional[int] =None
44
-
"""The maximum number of retry attempts, including the initial attempt, to complete the action.
45
-
If None, the action will be retried indefinitely, until it succeeds.
46
-
Otherwise, the action will be retried until the maximum number of attempts is reached and then it will raise a TerminalError."""
47
-
max_retry_duration: Optional[timedelta] =None
48
-
"""The maximum duration for retrying. If None, the action will be retried indefinitely, until it succeeds.
49
-
Otherwise, the action will be retried until the maximum duration is reached and then it will raise a TerminalError."""
50
44
type_hint: Optional[typing.Type[T]] =None
51
45
"""The type hint of the return value of the action. This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer."""
46
+
max_attempts: Optional[int] =None
47
+
"""Max number of attempts (including the initial), before giving up.
48
+
49
+
When giving up, `ctx.run` will throw a `TerminalError` wrapping the original error message."""
50
+
max_duration: Optional[timedelta] =None
51
+
"""Max duration of retries, before giving up.
52
+
53
+
When giving up, `ctx.run` will throw a `TerminalError` wrapping the original error message."""
54
+
initial_retry_interval: Optional[timedelta] =None
55
+
"""Initial interval for the first retry attempt.
56
+
Retry interval will grow by a factor specified in `retry_interval_factor`.
57
+
58
+
If any of the other retry related fields is specified, the default for this field is 50 milliseconds, otherwise restate will fallback to the overall invocation retry policy."""
59
+
max_retry_interval: Optional[timedelta] =None
60
+
"""Max interval between retries.
61
+
Retry interval will grow by a factor specified in `retry_interval_factor`.
62
+
63
+
The default is 10 seconds."""
64
+
retry_interval_factor: Optional[float] =None
65
+
"""Exponentiation factor to use when computing the next retry delay.
66
+
67
+
If any of the other retry related fields is specified, the default for this field is `2`, meaning retry interval will double at each attempt, otherwise restate will fallback to the overall invocation retry policy."""
0 commit comments