Table of Contents

Class Reactors

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

Represents an implementation of IReactors.

public class Reactors : IReactors
Inheritance
Reactors
Implements
Inherited Members
Extension Methods

Constructors

Reactors(IEventStore, IEventTypes, IClientArtifactsProvider, IServiceProvider, IReactorMiddlewares, IEventSerializer, ICausationManager, IIdentityProvider, ILogger<Reactors>, ILoggerFactory)

Initializes a new instance of the Reactors class.

public Reactors(IEventStore eventStore, IEventTypes eventTypes, IClientArtifactsProvider clientArtifactsProvider, IServiceProvider serviceProvider, IReactorMiddlewares middlewares, IEventSerializer eventSerializer, ICausationManager causationManager, IIdentityProvider identityProvider, ILogger<Reactors> logger, ILoggerFactory loggerFactory)

Parameters

eventStore IEventStore

IEventStore the Reactors belong to.

eventTypes IEventTypes

IEventTypes for resolving event types.

clientArtifactsProvider IClientArtifactsProvider

IClientArtifactsProvider for getting client artifacts.

serviceProvider IServiceProvider

IServiceProvider to get instances of types.

middlewares IReactorMiddlewares

IReactorMiddlewares to call.

eventSerializer IEventSerializer

IEventSerializer for serializing of events.

causationManager ICausationManager

ICausationManager for working with causation.

identityProvider IIdentityProvider

IIdentityProvider for managing identity context.

logger ILogger<Reactors>

ILogger for logging.

loggerFactory ILoggerFactory

ILoggerFactory for creating loggers.

Methods

Discover()

Discover all Reactors from the entry assembly and dependencies.

public Task Discover()

Returns

Task

Awaitable task.

GetFailedPartitionsFor(Type)

Get any failed partitions for a specific reactor.

public Task<IEnumerable<FailedPartition>> GetFailedPartitionsFor(Type reactorType)

Parameters

reactorType Type

Type of reducer.

Returns

Task<IEnumerable<FailedPartition>>

Collection of FailedPartition, if any.

GetFailedPartitionsFor<TReactor>()

Get any failed partitions for a specific reactor.

public Task<IEnumerable<FailedPartition>> GetFailedPartitionsFor<TReactor>()

Returns

Task<IEnumerable<FailedPartition>>

Collection of FailedPartition, if any.

Type Parameters

TReactor

Type of reducer.

GetHandlerById(ReactorId)

Gets a specific handler by its ReactorId.

public IReactorHandler GetHandlerById(ReactorId id)

Parameters

id ReactorId

ReactorId to get for.

Returns

IReactorHandler

ReactorHandler instance.

GetHandlerFor<TReactor>()

Gets a specific handler by its TReactor type.

public IReactorHandler GetHandlerFor<TReactor>() where TReactor : IReactor

Returns

IReactorHandler

ReactorHandler instance.

Type Parameters

TReactor

The reactor type.

GetStateFor<TReactor>()

Get the state of a specific reactor.

public Task<ReactorState> GetStateFor<TReactor>() where TReactor : IReactor

Returns

Task<ReactorState>

ReactorState.

Type Parameters

TReactor

Type of reactor get for.

Register()

Register all Reactors with Chronicle.

public Task Register()

Returns

Task

Awaitable task.

Register<TReactor>()

Registers a TReactor reactor with Chronicle.

public Task<IReactorHandler> Register<TReactor>() where TReactor : IReactor

Returns

Task<IReactorHandler>

Awaitable task.

Type Parameters

TReactor

The reactor type.

Replay(ReactorId)

Replay a specific reactor by its identifier.

public Task Replay(ReactorId reactorId)

Parameters

reactorId ReactorId

ReactorId to replay.

Returns

Task

Awaitable task.

Replay<TReactor>()

Replay a specific reactor.

public Task Replay<TReactor>() where TReactor : IReactor

Returns

Task

Awaitable task.

Type Parameters

TReactor

Type of reactor to replay.