Class ReactorContext
- Assembly
- Cratis.Chronicle.dll
Represents the combined context available to a IReactorSideEffectHandler when processing a value returned by a reactor handler method.
public record ReactorContext : IEquatable<ReactorContext>
- Inheritance
-
ReactorContext
- Implements
- Inherited Members
- Extension Methods
Constructors
ReactorContext(EventContext, object, ReactorContextValues)
Represents the combined context available to a IReactorSideEffectHandler when processing a value returned by a reactor handler method.
public ReactorContext(EventContext EventContext, object Reactor, ReactorContextValues Values)
Parameters
EventContextEventContextThe EventContext of the event that triggered the reactor.
ReactorobjectThe reactor instance that handled the event.
ValuesReactorContextValuesThe ReactorContextValues carrying append-metadata resolved for the side-effect.
ReactorContext(ReactorContext)
protected ReactorContext(ReactorContext original)
Parameters
originalReactorContext
Properties
Delivery
Gets the ReactorDelivery of the event that triggered the reactor, when the context was produced by the Chronicle invocation pipeline.
public ReactorDelivery? Delivery { get; init; }
Property Value
Remarks
Built-in handlers derive the idempotency keys of the events a reactor returns from this. It is null for contexts built outside the invocation pipeline, whose events are then appended without keys.
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
EventContext
The EventContext of the event that triggered the reactor.
public EventContext EventContext { get; init; }
Property Value
EventStore
Gets the IEventStore the reactor is running under, when the context was produced by the Chronicle invocation pipeline.
public IEventStore? EventStore { get; init; }
Property Value
Remarks
This lets callers of the previous event-store-less CanHandle contract reach the same per-store path
as current callers. It is not a constructor parameter so the previous three-parameter constructor and
deconstruction shape remain binary compatible.
Reactor
The reactor instance that handled the event.
public object Reactor { get; init; }
Property Value
Values
The ReactorContextValues carrying append-metadata resolved for the side-effect.
public ReactorContextValues Values { get; init; }
Property Value
Methods
Deconstruct(out EventContext, out object, out ReactorContextValues)
public void Deconstruct(out EventContext EventContext, out object Reactor, out ReactorContextValues Values)
Parameters
EventContextEventContextReactorobjectValuesReactorContextValues
Equals(ReactorContext?)
public virtual bool Equals(ReactorContext? other)
Parameters
otherReactorContext
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ReactorContext?, ReactorContext?)
public static bool operator ==(ReactorContext? left, ReactorContext? right)
Parameters
leftReactorContextrightReactorContext
Returns
operator !=(ReactorContext?, ReactorContext?)
public static bool operator !=(ReactorContext? left, ReactorContext? right)
Parameters
leftReactorContextrightReactorContext