Class ReactorHandler
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
eventStoreIEventStoreIEventStore the Reactors belong to.
reactorIdReactorIdUnique identifier.
reactorTypeTypeThe type of the reactor.
eventSequenceIdEventSequenceIdThe EventSequenceId the Reactor is for.
eventTypesIEnumerable<EventType>The IEnumerable<T> of EventType.
causationManagerICausationManagerICausationManager for working with causation.
identityProviderIIdentityProviderIIdentityProvider 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
CausationEventSequenceNumberProperty
The event sequence number causation property.
public const string CausationEventSequenceNumberProperty = "eventSequenceNumber"
Field Value
CausationEventTypeGenerationProperty
The event type generation causation property.
public const string CausationEventTypeGenerationProperty = "eventTypeGeneration"
Field Value
CausationEventTypeIdProperty
The event type causation property.
public const string CausationEventTypeIdProperty = "eventTypeId"
Field Value
CausationReactorIdProperty
The Reactor id causation property.
public const string CausationReactorIdProperty = "ReactorId"
Field Value
CausationType
The causation type for client Reactor.
public static readonly CausationType CausationType
Field Value
Properties
CancellationToken
Gets the CancellationToken for the handler.
public CancellationToken CancellationToken { get; }
Property Value
EventSequenceId
Gets the event log for the Reactor.
public EventSequenceId EventSequenceId { get; }
Property Value
EventTypes
Gets the event types for the Reactor.
public IEnumerable<EventType> EventTypes { get; }
Property Value
Id
Gets the unique identifier of the Reactor.
public ReactorId Id { get; }
Property Value
ReactorType
Gets the type of the reactor.
public Type ReactorType { 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 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
contextEventContextEventContext for the event.
contentobjectActual content.
reactorInvokerIReactorInvokerThe IReactorInvoker.