Table of Contents

Class ReactorHandler

Namespace
Cratis.Chronicle.Reactors
Assembly
Cratis.Chronicle.dll

Represents a handler of Reactors.

public class ReactorHandler : IDisposable, IReactorHandler
Inheritance
ReactorHandler
Implements
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the ReactorHandler.

Constructors

ReactorHandler(IEventStore, ReactorId, EventSequenceId, IReactorInvoker, ICausationManager, IIdentityProvider)

Represents a handler of Reactors.

public ReactorHandler(IEventStore eventStore, ReactorId reactorId, EventSequenceId eventSequenceId, IReactorInvoker reactorInvoker, ICausationManager causationManager, IIdentityProvider identityProvider)

Parameters

eventStore IEventStore

IEventStore the Reactors belong to.

reactorId ReactorId

Unique identifier.

eventSequenceId EventSequenceId

The EventSequenceId the Reactor is for.

reactorInvoker IReactorInvoker

The actual invoker.

causationManager ICausationManager

ICausationManager for working with causation.

identityProvider IIdentityProvider

IIdentityProvider for managing identity context.

Remarks

Initializes a new instance of the ReactorHandler.

Fields

CausationEventSequenceIdProperty

The event sequence id causation property.

public const string CausationEventSequenceIdProperty = "eventSequenceId"

Field Value

string

CausationEventSequenceNumberProperty

The event sequence number causation property.

public const string CausationEventSequenceNumberProperty = "eventSequenceNumber"

Field Value

string

CausationEventTypeGenerationProperty

The event type generation causation property.

public const string CausationEventTypeGenerationProperty = "eventTypeGeneration"

Field Value

string

CausationEventTypeIdProperty

The event type causation property.

public const string CausationEventTypeIdProperty = "eventTypeId"

Field Value

string

CausationReactorIdProperty

The Reactor id causation property.

public const string CausationReactorIdProperty = "ReactorId"

Field Value

string

CausationType

The causation type for client Reactor.

public static readonly CausationType CausationType

Field Value

CausationType

Properties

CancellationToken

Gets the CancellationToken for the handler.

public CancellationToken CancellationToken { get; }

Property Value

CancellationToken

EventSequenceId

Gets the event log for the Reactor.

public EventSequenceId EventSequenceId { get; }

Property Value

EventSequenceId

EventTypes

Gets the event types for the Reactor.

public IEnumerable<EventType> EventTypes { get; }

Property Value

IEnumerable<EventType>

Id

Gets the unique identifier of the Reactor.

public ReactorId Id { get; }

Property Value

ReactorId

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 reactor.

public Task<IEnumerable<FailedPartition>> GetFailedPartitions()

Returns

Task<IEnumerable<FailedPartition>>

Collection of FailedPartition, if any.

GetState()

Get the current state of the Reactor.

public Task<ReactorState> GetState()

Returns

Task<ReactorState>

Current ReactorState.

OnNext(EventMetadata, EventContext, object, IServiceProvider)

Handle next event.

public Task OnNext(EventMetadata metadata, EventContext context, object content, IServiceProvider serviceProvider)

Parameters

metadata EventMetadata

EventMetadata for the event.

context EventContext

EventContext for the event.

content object

Actual content.

serviceProvider IServiceProvider

The IServiceProvider for creating the actual instance of the reactor.

Returns

Task

Awaitable task.