Class ReducerHandler
Represents an implementation of IReducerHandler.
public class ReducerHandler : IReducerHandler, IHaveReadModel, IDisposable
- Inheritance
-
ReducerHandler
- Implements
- Inherited Members
- Extension Methods
Remarks
Initializes a new instance of the ReducerHandler class.
Constructors
ReducerHandler(IEventStore, ReducerId, Type, EventSequenceId, IReducerInvoker, bool, IReducerObservers)
Represents an implementation of IReducerHandler.
public ReducerHandler(IEventStore eventStore, ReducerId reducerId, Type reducerType, EventSequenceId eventSequenceId, IReducerInvoker invoker, bool isActive, IReducerObservers reducerObservers)
Parameters
eventStoreIEventStoreIEventStore the reducers belong to.
reducerIdReducerIdThe identifier of the reducer.
reducerTypeTypeThe type of the reducer.
eventSequenceIdEventSequenceIdThe EventSequenceId the reducer is for.
invokerIReducerInvokerThe actual invoker.
isActiveboolWhether or not reducer should be actively running on the Kernel.
reducerObserversIReducerObserversIReducerObservers for notifying observers of changes.
Remarks
Initializes a new instance of the ReducerHandler class.
Properties
CancellationToken
Gets the CancellationToken for the handler.
public CancellationToken CancellationToken { get; }
Property Value
ContainerName
Gets the container name of the read model (collection, table, etc.).
public ReadModelContainerName ContainerName { get; }
Property Value
EventSequenceId
Gets the event sequence the reducer is reducing from.
public EventSequenceId EventSequenceId { get; }
Property Value
EventTypes
Gets the event types for the reducer.
public IEnumerable<EventType> EventTypes { get; }
Property Value
Id
Gets the unique identifier of the reducer.
public ReducerId Id { get; }
Property Value
Invoker
Gets the IReducerInvoker that will perform the invocations.
public IReducerInvoker Invoker { get; }
Property Value
IsActive
Gets whether the reducer should be actively running on the Kernel.
public bool IsActive { get; }
Property Value
ReadModelType
Gets the type of the read model.
public Type ReadModelType { get; }
Property Value
ReducerType
Gets the type of the reducer.
public Type ReducerType { get; }
Property Value
Methods
Disconnect()
Disconnect the handler.
public void Disconnect()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetFailedPartitions()
Get any failed partitions for a specific reducer.
public Task<IEnumerable<FailedPartition>> GetFailedPartitions()
Returns
- Task<IEnumerable<FailedPartition>>
Collection of FailedPartition, if any.
GetState()
Get the current state of the reducer.
public Task<ReducerState> GetState()
Returns
- Task<ReducerState>
The current ReducerState.
OnNext(IEnumerable<AppendedEvent>, object?, IServiceProvider)
Handle next events as bulk.
public Task<ReduceResult> OnNext(IEnumerable<AppendedEvent> events, object? initial, IServiceProvider serviceProvider)
Parameters
eventsIEnumerable<AppendedEvent>Collection of AppendedEvent to handle.
initialobjectInitial read model value.
serviceProviderIServiceProviderThe IServiceProvider for creating the actual instance of the reducer.
Returns
- Task<ReduceResult>
Reduced read model.