ข้ามไปยังเนื้อหา

Class ChoreographySagaExecutionStrategy

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.Behaviors.Patterns.Strategies
Assembly: Cephalon.Behaviors.Patterns.dll

Executes behaviors that follow the choreography-based saga pattern. Publications returned by the behavior are staged through so other services or modules can continue the workflow by reacting to events.

public sealed class ChoreographySagaExecutionStrategy : IBehaviorExecutionStrategy

objectChoreographySagaExecutionStrategy

IBehaviorExecutionStrategy

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

ChoreographySagaExecutionStrategy(ISagaChoreographyPublisher, ILogger<ChoreographySagaExecutionStrategy>, ISagaChoreographyPublicationRuntimeStateCatalog?)

Section titled “ ChoreographySagaExecutionStrategy(ISagaChoreographyPublisher, ILogger<ChoreographySagaExecutionStrategy>, ISagaChoreographyPublicationRuntimeStateCatalog?)”

Initializes a new instance of .

public ChoreographySagaExecutionStrategy(ISagaChoreographyPublisher publisher, ILogger<ChoreographySagaExecutionStrategy> logger, ISagaChoreographyPublicationRuntimeStateCatalog? runtimeStateCatalog = null)

publisher ISagaChoreographyPublisher

The publisher used to stage choreography publications.

logger ILogger<ChoreographySagaExecutionStrategy>

The logger used to report accepted publications.

runtimeStateCatalog ISagaChoreographyPublicationRuntimeStateCatalog?

An optional runtime-state catalog that can also accept operator-facing live publication observations for choreography execution.

Gets the pattern identifier handled by this strategy.

public string Pattern { get; }

string

ExecuteAsync(BehaviorExecutionContext, CancellationToken)

Section titled “ ExecuteAsync(BehaviorExecutionContext, CancellationToken)”

Invokes the behavior and stages any returned publications through the choreography publisher. Behaviors may return a single , a sequence of them, or any when they need both local output and publications in the same step.

public Task<BehaviorExecutionResult> ExecuteAsync(BehaviorExecutionContext context, CancellationToken ct = default)

context BehaviorExecutionContext

The execution context for this invocation.

ct CancellationToken

A token that cancels the execution.

Task<BehaviorExecutionResult>

A result with HTTP 202 when at least one publication is staged; otherwise HTTP 200 or 204 based on whether the behavior produced a local output.