Interface IReactorMiddleware

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

Defines a middleware that can be called during the observing of events.

public interface IReactorMiddleware
Extension Methods

Methods

AfterInvoke(EventContext, object)

Invoked after the actual invoke.

Task AfterInvoke(EventContext eventContext, object @event)

Parameters

eventContext EventContext

EventContext for the event.

event object

The actual event that it will be called with.

Returns

Task

A Task representing the result of the asynchronous operation.

AfterInvoke(ReactorId, EventContext, object)

Invoked after the actual invoke, for a known reactor.

Task AfterInvoke(ReactorId reactorId, EventContext eventContext, object @event)

Parameters

reactorId ReactorId

The ReactorId of the reactor the event was observed for.

eventContext EventContext

EventContext for the event.

event object

The actual event that it will be called with.

Returns

Task

A Task representing the result of the asynchronous operation.

Remarks

This is the overload Chronicle calls. It defaults to the overload without the reactor, so a middleware written before the reactor was passed along keeps working; implement this one to know which reactor is running.

BeforeInvoke(EventContext, object)

Invoked before the actual invoke.

Task BeforeInvoke(EventContext eventContext, object @event)

Parameters

eventContext EventContext

EventContext for the event.

event object

The actual event that it will be called with.

Returns

Task

A Task representing the result of the asynchronous operation.

BeforeInvoke(ReactorId, EventContext, object)

Invoked before the actual invoke, for a known reactor.

Task BeforeInvoke(ReactorId reactorId, EventContext eventContext, object @event)

Parameters

reactorId ReactorId

The ReactorId of the reactor the event is being observed for.

eventContext EventContext

EventContext for the event.

event object

The actual event that it will be called with.

Returns

Task

A Task representing the result of the asynchronous operation.

Remarks

This is the overload Chronicle calls. It defaults to the overload without the reactor, so a middleware written before the reactor was passed along keeps working; implement this one to know which reactor is running.