Class ProcessorBase<T, TR>
- Namespace
- RisingV.Shared.Processors
- Assembly
- RisingV.Shared.dll
Base class for processors that handle events of type T and produce results of type TR.
public abstract class ProcessorBase<T, TR> : IProcessor<T, TR>, IProcessor, IManageable<ProcessorManager>, IManageable
Type Parameters
T
The type of the event to process.
TR
The type of the result produced by the processing.
- Inheritance
-
ProcessorBase<T, TR>
- Implements
-
IProcessor<T, TR>
- Derived
- Inherited Members
- Extension Methods
Methods
CanProcess(T, bool)
Determines whether the processor can handle the given event and whether it is a post-processing event.
public abstract bool CanProcess(T @event, bool isPost)
Parameters
event
TThe event to process.
isPost
boolIndicates whether the event is a post-processing event.
Returns
- bool
true if the processor can handle the event; otherwise, false.
PostProcess(T, out TR?)
Processes the given event and returns a token indicating the processing result.
public virtual ProcessToken PostProcess(T @event, out TR? result)
Parameters
event
TThe event to process.
result
TRAn output parameter that will hold the result of the processing.
Returns
- ProcessToken
A token indicating the processing result.
PreProcess(T, out TR?)
Pre-process the event before it is processed.
public virtual ProcessToken PreProcess(T @event, out TR? result)
Parameters
event
TThe event to process.
result
TRThe result of the processing.
Returns
- ProcessToken
A token indicating whether to continue processing or not.