Skip to content

Sync subscriptions - #338

Merged
DavidBadura merged 1 commit into
4.0.xfrom
sync-subscriptions
Oct 3, 2026
Merged

DavidBadura merged 1 commit into
4.0.xfrom
sync-subscriptions

Conversation

@DavidBadura

@DavidBadura DavidBadura commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Until now the subscription engine was either run in a worker or reconfigured for dev to run everything after an aggregate was saved. This replaces catch_up, throw_on_error and run_after_aggregate_save with a single sync option, so both modes can be combined.

With sync: true all subscriptions run directly after saving an aggregate, which is what you want in dev and test. In prod you can limit it with ids and groups, e.g. groups: ['sync'], and everything else stays async in the worker. The worker still processes sync subscriptions too, so failed ones get retried.

Catch up is always active for the sync run and can be limited with catch_up_limit. Catch up and throw_on_error now only wrap a dedicated sync engine instead of decorating the global one, so the worker and console commands are no longer affected.

Docs are updated and the upgrade guide got a section for the new option.

@DavidBadura DavidBadura mentioned this pull request Oct 3, 2026
…nc option

Subscriptions can now be processed sync after an aggregate has been saved,
filtered by ids and groups, while the rest is still handled by the worker.
Catch up and throw on error only apply to this sync run and no longer
decorate the global subscription engine used by the worker and commands.
@DavidBadura
DavidBadura merged commit 2e7e2b7 into 4.0.x Oct 3, 2026
22 of 23 checks passed
@DavidBadura
DavidBadura deleted the sync-subscriptions branch October 3, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants