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
TThe type of the event to process.
TRThe 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
eventTThe event to process.
isPostboolIndicates 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
eventTThe event to process.
resultTRAn 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
eventTThe event to process.
resultTRThe result of the processing.
Returns
- ProcessToken
A token indicating whether to continue processing or not.