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, Type, EventSequenceId, IEnumerable<EventType>, ICausationManager, IIdentityProvider)

Represents a handler of Reactors.

public ReactorHandler(IEventStore eventStore, ReactorId reactorId, Type reactorType, EventSequenceId eventSequenceId, IEnumerable<EventType> eventTypes, ICausationManager causationManager, IIdentityProvider identityProvider)

Parameters

eventStore IEventStore

IEventStore the Reactors belong to.

reactorId ReactorId

Unique identifier.

reactorType Type

The type of the reactor.

eventSequenceId EventSequenceId

The EventSequenceId the Reactor is for.

eventTypes IEnumerable<EventType>

The IEnumerable<T> of EventType.

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

ReactorType

Gets the type of the reactor.

public Type ReactorType { get; }

Property Value

Type

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(EventContext, object, IReactorInvoker)

Handle next event.

public Task<Catch> OnNext(EventContext context, object content, IReactorInvoker reactorInvoker)

Parameters

context EventContext

EventContext for the event.

content object

Actual content.

reactorInvoker IReactorInvoker

The IReactorInvoker.

Returns

Task<Catch>

Awaitable task.