chrono_machines 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +2 -0
- data/ext/chrono_machines_native/core/Cargo.toml +1 -1
- data/ext/chrono_machines_native/core/src/retry.rs +13 -21
- data/lib/chrono_machines/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4195a7a57a7069769ba6b45dec7b2187ffd78be09e03d79c6b744881306423d
|
|
4
|
+
data.tar.gz: 17d103b281d335cd9b0d2d78590a57f9eb5f5e68eaf3910aa07b51ccfe1a7cb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d8638c3dbdfa33e746beecba8e3e5cfc92a75cce7c315a604d07a5e108188dcff339a03406c66e220a2dcaa8ec28115d9b3047179fdbe214e9ba95b1115f0ce
|
|
7
|
+
data.tar.gz: 167d0237c2ff6ea4e0958befc179f60b5a518b44ac86106a3409f5a0ae611809b1a43520a928d3a5026cd1389429aeab856f7d15522df3703259767d23100020
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.11.0](https://github.com/seuros/chrono_machines/compare/chrono_machines/v0.10.0...chrono_machines/v0.11.0) (2026-10-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **core:** RetryError::cause() returns &E and into_cause() returns E instead of Option.
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **core:** RetryError always carries its cause ([e5222a3](https://github.com/seuros/chrono_machines/commit/e5222a3c394974ba86605944f02d820345cbae8e))
|
|
13
|
+
|
|
3
14
|
## [0.10.0](https://github.com/seuros/chrono_machines/compare/chrono_machines/v0.9.2...chrono_machines/v0.10.0) (2026-10-11)
|
|
4
15
|
|
|
5
16
|
|
data/README.md
CHANGED
|
@@ -223,6 +223,8 @@ Anything else raises `ArgumentError` - a broken hook fails loudly instead of sil
|
|
|
223
223
|
|
|
224
224
|
### Scheduling retries without sleeping
|
|
225
225
|
|
|
226
|
+
See the [Rails integration guide](docs/RAILS_INTEGRATION.md) for Active Job patterns, policy callbacks, and safe retries.
|
|
227
|
+
|
|
226
228
|
`Executor#next_delay(attempt:, exception: nil)` returns seconds to wait, or `nil` to stop. `attempt: 1` means the initial call has failed; `max_attempts` includes that initial call. It uses the same backoff, jitter, exception rules, and `delay_from` hints as `call`, without executing work, sleeping, or running lifecycle callbacks. The caller owns the attempt count and scheduling. Without an exception, `delay_from` and exception filtering are skipped.
|
|
227
229
|
|
|
228
230
|
For Active Job's `retry_on`, keep the attempt limit in sync with the policy:
|
|
@@ -51,13 +51,7 @@ fn finalize_failure<E>(
|
|
|
51
51
|
cumulative_delay_ms: u64,
|
|
52
52
|
error: E,
|
|
53
53
|
) -> RetryError<E> {
|
|
54
|
-
let retry_error = RetryError::new(
|
|
55
|
-
kind,
|
|
56
|
-
attempt,
|
|
57
|
-
max_attempts,
|
|
58
|
-
cumulative_delay_ms,
|
|
59
|
-
Some(error),
|
|
60
|
-
);
|
|
54
|
+
let retry_error = RetryError::new(kind, attempt, max_attempts, cumulative_delay_ms, error);
|
|
61
55
|
if let Some(callback) = on_failure {
|
|
62
56
|
callback(&retry_error);
|
|
63
57
|
}
|
|
@@ -99,7 +93,7 @@ pub struct RetryError<E> {
|
|
|
99
93
|
attempts: u8,
|
|
100
94
|
max_attempts: u8,
|
|
101
95
|
cumulative_delay_ms: u64,
|
|
102
|
-
cause:
|
|
96
|
+
cause: E,
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
impl<E> RetryError<E> {
|
|
@@ -108,7 +102,7 @@ impl<E> RetryError<E> {
|
|
|
108
102
|
attempts: u8,
|
|
109
103
|
max_attempts: u8,
|
|
110
104
|
cumulative_delay_ms: u64,
|
|
111
|
-
cause:
|
|
105
|
+
cause: E,
|
|
112
106
|
) -> Self {
|
|
113
107
|
Self {
|
|
114
108
|
kind,
|
|
@@ -119,13 +113,13 @@ impl<E> RetryError<E> {
|
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
115
|
|
|
122
|
-
///
|
|
123
|
-
pub const fn cause(&self) ->
|
|
124
|
-
self.cause
|
|
116
|
+
/// The error from the final attempt.
|
|
117
|
+
pub const fn cause(&self) -> &E {
|
|
118
|
+
&self.cause
|
|
125
119
|
}
|
|
126
120
|
|
|
127
|
-
/// Consume the error and return the
|
|
128
|
-
pub fn into_cause(self) ->
|
|
121
|
+
/// Consume the error and return the error from the final attempt.
|
|
122
|
+
pub fn into_cause(self) -> E {
|
|
129
123
|
self.cause
|
|
130
124
|
}
|
|
131
125
|
|
|
@@ -175,13 +169,11 @@ where
|
|
|
175
169
|
}
|
|
176
170
|
}
|
|
177
171
|
|
|
178
|
-
write!(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
Ok(())
|
|
172
|
+
write!(
|
|
173
|
+
f,
|
|
174
|
+
" (cumulative delay {}ms): {}",
|
|
175
|
+
self.cumulative_delay_ms, self.cause
|
|
176
|
+
)
|
|
185
177
|
}
|
|
186
178
|
}
|
|
187
179
|
|