Interface PipelineOrganization
- All Superinterfaces:
com.tnsai.agents.groups.AgentGroup
- All Known Implementing Classes:
DefaultPipelineOrg
public interface PipelineOrganization
extends com.tnsai.agents.groups.AgentGroup
A sequential processing pipeline where tasks flow through ordered stages.
PipelineOrganization extends AgentGroup with sequential stage processing, inter-stage data transformation, and pipeline-specific metrics.
Key Features
- Ordered stages: Tasks flow through stages in sequence
- Stage connectors: Optional transformation between stages
- Pipeline metrics: Per-stage timing and bottleneck detection
- Fail-fast: Pipeline stops on first stage failure
Usage Example
PipelineOrganization pipeline = PipelineOrganization.builder()
.name("Data Processing Pipeline")
.addStage("extract", extractorAgent)
.addStage("transform", transformerAgent)
.addStage("load", loaderAgent)
.build();
pipeline.start();
PipelineResult result = pipeline.execute("Process dataset X");
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new stage at the end of the pipeline.static PipelineBuilderbuilder()Creates a new PipelineOrganization builder.Executes the pipeline with the given input.Returns the current bottleneck stage (slowest).Returns the pipeline metrics.Returns all stages in pipeline order.Methods inherited from interface com.tnsai.agents.groups.AgentGroup
addLifecycleListener, addMember, addMembershipListener, assignTask, broadcast, broadcast, dissolve, electLeader, electLeader, findMembers, getDescription, getEventBus, getId, getLeader, getLifecycle, getMember, getMemberCount, getMembers, getMembershipManager, getMetrics, getName, getPolicy, hasMember, isActive, isDissolved, removeLifecycleListener, removeMember, removeMembershipListener, scatter, scatter, scatterAsync, setPolicy, start, stop, stopNow
-
Method Details
-
getStages
Returns all stages in pipeline order.- Returns:
- ordered list of stages
-
addStage
Adds a new stage at the end of the pipeline.- Parameters:
name- stage nameagentId- agent ID for this stage- Throws:
IllegalArgumentException- if agent is not a member
-
execute
Executes the pipeline with the given input. Data flows sequentially through each stage.- Parameters:
input- initial input- Returns:
- pipeline execution result
-
getPipelineMetrics
PipelineMetrics getPipelineMetrics()Returns the pipeline metrics.- Returns:
- pipeline metrics
-
getBottleneck
Returns the current bottleneck stage (slowest).- Returns:
- bottleneck stage name, or empty if no data
-
builder
Creates a new PipelineOrganization builder.- Returns:
- builder
-