Table of Contents

Class ReactorTypeExtensions

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

Extension methods for working with Reactors and type discovery.

public static class ReactorTypeExtensions
Inheritance
ReactorTypeExtensions
Inherited Members

Methods

AllReactors(IEnumerable<Type>)

Find all Reactors.

public static IEnumerable<Type> AllReactors(this IEnumerable<Type> types)

Parameters

types IEnumerable<Type>

Collection of types.

Returns

IEnumerable<Type>

Collection of types that are Reactors.

GetEventSequenceId(Type, string?)

Get the event sequence id for a Reactor type.

public static EventSequenceId GetEventSequenceId(this Type type, string? currentEventStoreName = null)

Parameters

type Type

Type to get from.

currentEventStoreName string

The name of the event store the reactor is registered in. When provided, event types that belong to the same store will resolve to the event log rather than an inbox sequence.

Returns

EventSequenceId

The EventSequenceId for the type.

Exceptions

MultipleEventStoresDefined

Thrown when the reactor handles event types from multiple event stores.

GetHandlerEventTypes(Type)

Get all event types used in the handler method signatures of a reactor type.

public static IEnumerable<Type> GetHandlerEventTypes(this Type type)

Parameters

type Type

Type to get from.

Returns

IEnumerable<Type>

All event types found as first parameters in handler methods.

Remarks

A handler method is any non-special public or non-public instance method whose first parameter type carries the EventTypeAttribute. Duplicates are removed so each event type appears at most once.

GetReactorId(Type)

Get the Reactor id for a Reactor type.

public static ReactorId GetReactorId(this Type type)

Parameters

type Type

Type to get from.

Returns

ReactorId

The ReactorId for the type.

HasExplicitEventSequence(Type)

Get whether a Reactor type has an explicit event sequence set.

public static bool HasExplicitEventSequence(this Type type)

Parameters

type Type

Type to check.

Returns

bool

true if an explicit event sequence is configured; otherwise false.