Class EventDrivenExecutionStrategy
Namespace: Cephalon.Behaviors.Patterns.Strategies
Assembly: Cephalon.Behaviors.Patterns.dll
Executes behaviors that follow the event-driven (fire-and-forget) pattern. Returns HTTP 202 Accepted immediately while the behavior runs in the background.
public sealed class EventDrivenExecutionStrategy : IBehaviorExecutionStrategyInheritance
Section titled “Inheritance”object ← EventDrivenExecutionStrategy
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
Section titled “Constructors”EventDrivenExecutionStrategy(ILogger<EventDrivenExecutionStrategy>)
Section titled “ EventDrivenExecutionStrategy(ILogger<EventDrivenExecutionStrategy>)”Initializes a new instance of
public EventDrivenExecutionStrategy(ILogger<EventDrivenExecutionStrategy> logger)Parameters
Section titled “Parameters”logger ILogger<EventDrivenExecutionStrategy>
The logger used to report background faults.
Properties
Section titled “Properties”Pattern
Section titled “ Pattern”Gets the pattern identifier handled by this strategy.
public string Pattern { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ExecuteAsync(BehaviorExecutionContext, CancellationToken)
Section titled “ ExecuteAsync(BehaviorExecutionContext, CancellationToken)”Dispatches the behavior invocation on a background thread and immediately returns 202 Accepted. Any exception thrown synchronously before the background task is launched propagates to the caller. Background faults are caught and logged; they do not surface to the caller.
public Task<BehaviorExecutionResult> ExecuteAsync(BehaviorExecutionContext context, CancellationToken ct = default)Parameters
Section titled “Parameters”context BehaviorExecutionContext
The execution context for this invocation.
A token that cancels the execution.
Returns
Section titled “Returns”A fire-and-forget result with HTTP 202.