Class ReducerHandler
Represents an implementation of IReducerHandler.
public class ReducerHandler : IReducerHandler, IDisposable
- Inheritance
-
ReducerHandler
- Implements
- Inherited Members
- Extension Methods
Remarks
Initializes a new instance of the ReducerHandler class.
Constructors
ReducerHandler(IEventStore, ReducerId, EventSequenceId, IReducerInvoker, IEventSerializer, bool)
Represents an implementation of IReducerHandler.
public ReducerHandler(IEventStore eventStore, ReducerId reducerId, EventSequenceId eventSequenceId, IReducerInvoker invoker, IEventSerializer eventSerializer, bool isActive)
Parameters
eventStore
IEventStoreIEventStore the reducers belong to.
reducerId
ReducerIdThe identifier of the reducer.
eventSequenceId
EventSequenceIdThe EventSequenceId the reducer is for.
invoker
IReducerInvokerThe actual invoker.
eventSerializer
IEventSerializerThe event serializer to use.
isActive
boolWhether or not reducer should be actively running on the Kernel.
Remarks
Initializes a new instance of the ReducerHandler class.
Properties
CancellationToken
Gets the CancellationToken for the handler.
public CancellationToken CancellationToken { 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
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
events
IEnumerable<AppendedEvent>Collection of AppendedEvent to handle.
initial
objectInitial read model value.
serviceProvider
IServiceProviderThe IServiceProvider for creating the actual instance of the reducer.
Returns
- Task<ReduceResult>
Reduced read model.