Commit 47f2d24
committed
fix(saga): require Arc<S> in SagaAdapter to guarantee shared state across bus subscriptions
SagaAdapter previously accepted S by value, meaning saga.clone() could
produce independent copies with diverging state for callers whose saga
struct does not internally Arc its own mutable fields.
Changes:
- Add blanket SubscriberId impl for Arc<S> in epoch_core::subscriber_id
- Add blanket Saga<ED> impl for Arc<S> in epoch_core::saga (requires
S::EventType: Sync for async future Send bounds)
- Change SagaAdapter.saga field and new() parameter from S to Arc<S>
- Update saga_adapter_integration_tests to use Arc::new(saga)1 parent faf8936 commit 47f2d24
3 files changed
Lines changed: 68 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
179 | 222 | | |
180 | 223 | | |
181 | 224 | | |
| |||
300 | 343 | | |
301 | 344 | | |
302 | 345 | | |
303 | | - | |
| 346 | + | |
304 | 347 | | |
305 | 348 | | |
306 | 349 | | |
| |||
315 | 358 | | |
316 | 359 | | |
317 | 360 | | |
318 | | - | |
319 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
320 | 365 | | |
321 | 366 | | |
322 | 367 | | |
323 | 368 | | |
324 | 369 | | |
325 | 370 | | |
326 | | - | |
| 371 | + | |
327 | 372 | | |
328 | 373 | | |
329 | 374 | | |
| |||
341 | 386 | | |
342 | 387 | | |
343 | 388 | | |
344 | | - | |
| 389 | + | |
345 | 390 | | |
346 | 391 | | |
347 | 392 | | |
| |||
384 | 429 | | |
385 | 430 | | |
386 | 431 | | |
387 | | - | |
| 432 | + | |
388 | 433 | | |
389 | 434 | | |
390 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
0 commit comments