Add command side effect handlers for Chronicle reactors#2290
Conversation
|
NuGet packages for this PR, e.g. Cratis.Arc: |
|
@copilot Rebase on top of origin/main and then add documentation for this new capability. |
I've completed the rebase on top of origin/main and added comprehensive documentation for the new command side effect handlers. The documentation includes:
All markdown linting and link verification checks pass. The changes are now in commit 44d38c5. |
… expression' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
… expression' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
|
@copilot Fix the build errors: https://github.com/Cratis/Arc/actions/runs/27669886997/job/81831677028?pr=2290 |
BehaviorSubject is wrapped in DisposableQueryHealthSubject which correctly handles disposal of both the subject and the subscription.
Use conditional access operator (?.) instead of null checks followed by method calls to satisfy Roslynator RCS1146 rule.
Fixed the build errors. The issues were:
The Chronicle project now builds successfully with no errors or warnings. |
… expression' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
… expression' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
|
NuGet packages for this PR, e.g. Cratis.Arc: |
Summary
Reactors can now return commands as side effects, executed transactionally via
IReactorSideEffectHandler.Added
CommandResultHandlerfor single command return values from reactorsCommandsResultHandlerfor multiple command return values from reactorsCommandExecutionFailedExceptionthrown when command execution fails within a reactorImplementation Details
Both handlers implement
IReactorSideEffectHandlerfrom Cratis.Chronicle, marked[Singleton]for auto-discovery. Each creates a dedicatedIServiceScopeper execution for transactional behavior. Commands validated using existingIsCommand()extension. Failed commands throwCommandExecutionFailedExceptionto fail the reactor. Multiple commands execute sequentially in the same scope.Usage