Class ReactorAttribute

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

Attribute used to adorn classes to tell Cratis that the class is an Reactor.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ReactorAttribute : Attribute
Inheritance
ReactorAttribute
Inherited Members
Extension Methods

Constructors

ReactorAttribute(string, string?)

Attribute used to adorn classes to tell Cratis that the class is an Reactor.

public ReactorAttribute(string id = "", string? eventSequence = null)

Parameters

id string

Optional Id represented as string, if not used it will default to the fully qualified type name.

eventSequence string

Optional the name of the event sequence to observe. When not specified, the event sequence is inferred from the event types handled by the reactor.

ReactorAttribute(string, string?, uint)

Initializes a new instance of the ReactorAttribute class with an event sequence and an effect epoch.

public ReactorAttribute(string id, string? eventSequence, uint effectEpoch)

Parameters

id string

The Id represented as string, if empty it will default to the fully qualified type name.

eventSequence string

The name of the event sequence to observe, or null to infer it from the handled event types.

effectEpoch uint

The EffectEpoch of the reactor.

ReactorAttribute(string, uint)

Initializes a new instance of the ReactorAttribute class with an effect epoch.

public ReactorAttribute(string id, uint effectEpoch)

Parameters

id string

The Id represented as string, if empty it will default to the fully qualified type name.

effectEpoch uint

The EffectEpoch of the reactor.

Properties

EffectEpoch

Gets the effect epoch of the reactor. Defaults to 0.

public uint EffectEpoch { get; }

Property Value

uint

Remarks

The epoch is part of the idempotency key Chronicle derives for the events a reactor returns. Raising it starts a new key space, so a delivery whose output changed can be appended again under new keys. It does not change the reactor's id or the Id of any delivery.

EventSequenceId

Gets the explicit event sequence identifier, or null if not specified.

public EventSequenceId? EventSequenceId { get; }

Property Value

EventSequenceId

Remarks

When null, the event sequence is inferred from the event types handled by the reactor. If all handled event types originate from the same event store (via EventStoreAttribute), the reactor will automatically subscribe to the corresponding inbox event sequence.

Id

Gets the unique identifier for an Reactor.

public ReactorId Id { get; }

Property Value

ReactorId