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, 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
IEventStoreIEventStore the Reactors belong to.
reactorId
ReactorIdUnique identifier.
eventSequenceId
EventSequenceIdThe EventSequenceId the Reactor is for.
reactorInvoker
IReactorInvokerThe actual invoker.
causationManager
ICausationManagerICausationManager for working with causation.
identityProvider
IIdentityProviderIIdentityProvider 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
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
EventMetadataEventMetadata for the event.
context
EventContextEventContext for the event.
content
objectActual content.
serviceProvider
IServiceProviderThe IServiceProvider for creating the actual instance of the reactor.
Returns
- Task
Awaitable task.