Class StreamLifecycleClient
java.lang.Object
org.a2aproject.sdk.examples.streamlifecycle.client.StreamLifecycleClient
Demonstrates the TaskStreamLifecycleHook by connecting 3 subscribers to a task.
Flow:
- Subscriber 1: sends a message (creates the task, starts streaming)
- Subscriber 2: subscribes to the same task
- Both subscribers receive progress messages from the agent
- Subscriber 3: subscribes — the server hook detects 3 subscribers and closes all streams
- All subscribers see their streams end gracefully
Start the server first (mvn quarkus:dev in the server module), then run this client.
This class also serves as the integration test body — runAndVerify(AgentCard, String)
is called by the server module's @QuarkusTest for each transport protocol.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidlogEvent(String subscriber, ClientEvent event) static voidstatic voidrunAndVerify(AgentCard agentCard, String protocol) Runs the 3-subscriber scenario and asserts correctness.static void
-
Constructor Details
-
StreamLifecycleClient
public StreamLifecycleClient()
-
-
Method Details