CHR0054: Reactor method has an unsupported return type
Rule description
Section titled “Rule description”A reactor method whose first parameter is an [EventType] but whose synchronous return type is neither a built-in supported shape nor claimed by a registered side-effect handler is skipped during handler discovery. CHR0054 reports return types the analyzer cannot recognize, rather than treating them as unresolvable parameters.
Severity
Section titled “Severity”Warning
Supported returns
Section titled “Supported returns”voidorTask.- A registered event type,
EventForEventSourceId, orEventsWithConcurrencyScopes. - A custom type marked
[ReactorSideEffect]fromCratis.Chronicle.Reactors.SideEffects, including types deriving from a marked base class or implementing a marked interface. - A one-dimensional array or
IEnumerable<T>implementation whereTis a registered event type,EventForEventSourceId,object(for mixed events and targeted events), or a marked side-effect type. Task<T>for any side effect that a registered reactor side-effect handler can process, including the shapes above.
Synchronous custom side effects require a registered IReactorSideEffectHandler whose CanHandleReturnType(Type) claims the declared return type and which processes the returned value. Mark the custom type [ReactorSideEffect] so the analyzer accepts it; the marker only informs the analyzer and registers nothing. For a collection return, the handler must claim and process the collection type, not only its elements. See Custom return type handlers.