-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Side effect mode #360
Side effect mode #360
Conversation
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
A new `runModeFor` method is introduced in `SideEffect`, with the default set to `Async` to ensure backward compatibility. With `Async` mode, it triggers in *run & forget* mode so that command reply is not delayed by any lengthy side-effect. With `Sync` mode, the side-effect runs to completion before the next command is processed by the entity: this can be useful to simplify the side-effect logic as it precludes accounting for concurrency, but can hurt the system's responsiveness.
5150f13
to
5dc505d
Compare
A new
runModeFor
method is introduced inSideEffect
, with the default set toAsync
to ensure backward compatibility. WithAsync
mode, it triggers in run & forget mode so that any lengthy side-effect does not delay command reply. WithSync
mode, the side-effect runs to completion before the entity processes the next command: this can simplify the side-effect logic as it precludes accounting for concurrency, but can hurt the system's responsiveness.