Class ChoreographyEngine
java.lang.Object
com.tnsai.coordination.choreography.ChoreographyEngine
Executes a choreography specification using decentralized agent coordination.
Each agent reacts to events autonomously based on the declarative spec.
Example usage:
ChoreographyEngine engine = ChoreographyEngine.builder()
.spec(spec)
.agent("validator", validatorAgent)
.agent("billing", billingAgent)
.timeout(Duration.ofMinutes(2))
.build();
ChoreographyResult result = engine.execute();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordResult of the entire choreography execution.static final recordResult of a single interaction step. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChoreographyEngine.Builderbuilder()eventBus()Returns the event bus (for inspection/testing).execute()Executes the choreography synchronously.Executes the choreography asynchronously.
-
Method Details
-
execute
Executes the choreography synchronously. Sets up subscriptions based on the spec, fires initial events, and waits for all interactions to complete or timeout. -
executeAsync
Executes the choreography asynchronously. -
eventBus
Returns the event bus (for inspection/testing). -
builder
-