Table of Contents

Interface IReducerHandler

Namespace
Cratis.Chronicle.Reducers
Assembly
Cratis.Chronicle.dll

Defines a system that handle events for a specific reducer.

public interface IReducerHandler
Extension Methods

Properties

CancellationToken

Gets the CancellationToken for the handler.

CancellationToken CancellationToken { get; }

Property Value

CancellationToken

EventSequenceId

Gets the event sequence the reducer is reducing from.

EventSequenceId EventSequenceId { get; }

Property Value

EventSequenceId

EventTypes

Gets the event types for the reducer.

IEnumerable<EventType> EventTypes { get; }

Property Value

IEnumerable<EventType>

Id

Gets the unique identifier of the reducer.

ReducerId Id { get; }

Property Value

ReducerId

Invoker

Gets the IReducerInvoker that will perform the invocations.

IReducerInvoker Invoker { get; }

Property Value

IReducerInvoker

IsActive

Gets whether the reducer should be actively running on the Kernel.

bool IsActive { get; }

Property Value

bool

ReadModelType

Gets the type of the read model.

Type ReadModelType { get; }

Property Value

Type

Methods

Disconnect()

Disconnect the handler.

void Disconnect()

GetFailedPartitions()

Get any failed partitions for a specific reducer.

Task<IEnumerable<FailedPartition>> GetFailedPartitions()

Returns

Task<IEnumerable<FailedPartition>>

Collection of FailedPartition, if any.

GetState()

Get the current state of the reducer.

Task<ReducerState> GetState()

Returns

Task<ReducerState>

The current ReducerState.

OnNext(IEnumerable<AppendedEvent>, object?, IServiceProvider)

Handle next events as bulk.

Task<ReduceResult> OnNext(IEnumerable<AppendedEvent> events, object? initial, IServiceProvider serviceProvider)

Parameters

events IEnumerable<AppendedEvent>

Collection of AppendedEvent to handle.

initial object

Initial read model value.

serviceProvider IServiceProvider

The IServiceProvider for creating the actual instance of the reducer.

Returns

Task<ReduceResult>

Reduced read model.