Interface IReactorSideEffectHandlers
- Assembly
- Cratis.Chronicle.dll
Defines a system for managing IReactorSideEffectHandler instances and dispatching return values to them.
public interface IReactorSideEffectHandlers
- Extension Methods
Methods
CanHandle(ReactorContext, IEventStore, object)
Determines whether any registered handler can process the given return value.
bool CanHandle(ReactorContext reactorContext, IEventStore eventStore, object value)
Parameters
reactorContextReactorContextThe ReactorContext for the reactor invocation.
eventStoreIEventStoreThe IEventStore the reactor is running under.
valueobjectThe value returned by the reactor handler method.
Returns
Remarks
Defaults to the event-store-less overload so an implementation written against the previous contract keeps working unchanged.
CanHandle(ReactorContext, object)
Determines whether any registered handler can process the given return value.
bool CanHandle(ReactorContext reactorContext, object value)
Parameters
reactorContextReactorContextThe ReactorContext for the reactor invocation.
valueobjectThe value returned by the reactor handler method.
Returns
CanHandleReturnType(Type)
Determines whether any registered handler claims a synchronous reactor return type.
bool CanHandleReturnType(Type type)
Parameters
typeTypeThe declared return type of the reactor method.
Returns
Remarks
Defaults to false for existing dispatcher implementations.
Handle(ReactorContext, IEventStore, object)
Dispatches the return value to all handlers that can process it.
Task<Result<ReactorSideEffectFailure>> Handle(ReactorContext reactorContext, IEventStore eventStore, object value)
Parameters
reactorContextReactorContextThe ReactorContext for the reactor invocation.
eventStoreIEventStoreThe IEventStore to use for appending events.
valueobjectThe value returned by the reactor handler method.
Returns
- Task<Result<ReactorSideEffectFailure>>
A Task representing the asynchronous operation.