Interface IReducers
Defines a system for working with reducer registrations for the Kernel.
public interface IReducers
- Extension Methods
Methods
Discover()
Discover all reducers from the entry assembly and dependencies.
Task Discover()
Returns
- Task
Awaitable task.
GetAllHandlers()
Get all registered handlers.
IEnumerable<IReducerHandler> GetAllHandlers()
Returns
- IEnumerable<IReducerHandler>
Collection of IReducerHandler.
GetClrType(ReducerId)
Get the CLR type for a specific reducer.
Type GetClrType(ReducerId reducerId)
Parameters
Returns
- Type
The type.
GetFailedPartitionsFor(Type)
Get any failed partitions for a specific reducer.
Task<IEnumerable<FailedPartition>> GetFailedPartitionsFor(Type reducerType)
Parameters
reducerType
TypeType of reducer.
Returns
- Task<IEnumerable<FailedPartition>>
Collection of FailedPartition, if any.
GetFailedPartitionsFor<TReducer>()
Get any failed partitions for a specific reducer.
Task<IEnumerable<FailedPartition>> GetFailedPartitionsFor<TReducer>() where TReducer : IReducer
Returns
- Task<IEnumerable<FailedPartition>>
Collection of FailedPartition, if any.
Type Parameters
TReducer
Type of reducer.
GetHandlerById(ReducerId)
Get all registered reducers by its identifier.
IReducerHandler GetHandlerById(ReducerId reducerId)
Parameters
reducerId
ReducerIdThe identifier of the reducer to get.
Returns
- IReducerHandler
IReducerHandler instance.
GetHandlerFor(Type)
Gets a specific handler by its reducer type.
IReducerHandler GetHandlerFor(Type reducerType)
Parameters
reducerType
TypeThe reducer type to get for.
Returns
GetHandlerForReadModelType(Type)
Get a specific handler for a specific model type.
IReducerHandler GetHandlerForReadModelType(Type modelType)
Parameters
modelType
TypeModel type to get for.
Returns
- IReducerHandler
IReducerHandler instance.
GetHandlerFor<TReducer>()
Get a specific handler for a specific reducer.
IReducerHandler GetHandlerFor<TReducer>() where TReducer : IReducer
Returns
Type Parameters
TReducer
Type of reducer to get for.
GetStateFor<TReducer>()
Get the state of a specific reactor.
Task<ReducerState> GetStateFor<TReducer>() where TReducer : IReducer
Returns
Type Parameters
TReducer
Type of reactor get for.
HasReducerFor(Type)
Check if there is a reducer for a specific model type.
bool HasReducerFor(Type modelType)
Parameters
modelType
TypeModel type to check for.
Returns
- bool
True if it has, false if not.
Register()
Register all reducers with Chronicle.
Task Register()
Returns
- Task
Awaitable task.
Register<TReducer, TModel>()
Registers a TReducer
reducer with Chronicle.
Task<IReducerHandler> Register<TReducer, TModel>() where TReducer : IReducerFor<TModel> where TModel : class
Returns
- Task<IReducerHandler>
Awaitable task.
Type Parameters
TReducer
The reactor type.
TModel
The model type the reducer is for.
Replay(ReducerId)
Replay a specific reducer by its identifier.
Task Replay(ReducerId reducerId)
Parameters
Returns
- Task
Awaitable task.
Replay<TReducer>()
Replay a specific reducer.
Task Replay<TReducer>() where TReducer : IReducer
Returns
- Task
Awaitable task.
Type Parameters
TReducer
Type of reducer to replay.