Package com.embabel.agent.web.sse
Class SSEController
-
- All Implemented Interfaces:
-
com.embabel.agent.event.AgenticEventListener
@RestController() public final class SSEController implements AgenticEventListener
Spring Controller for Server-Sent Events (SSE) streaming of AgentProcessEvents. This controller by being registered as a bean via the RestController annotation will automatically listen for AgentProcessEvents because it implements AgenticEventListener. Each new listener will receive all events for that process to date.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringSSE_EVENT_NAME
-
Constructor Summary
Constructors Constructor Description SSEController(SseProperties sseProperties)
-
Method Summary
Modifier and Type Method Description UnitonProcessEvent(AgentProcessEvent event)Listen to an event during the execution of an AgentProcess final SseEmitterstreamEventsForId(@PathVariable() String processId)-
-
Constructor Detail
-
SSEController
SSEController(SseProperties sseProperties)
-
-
Method Detail
-
onProcessEvent
Unit onProcessEvent(AgentProcessEvent event)
Listen to an event during the execution of an AgentProcess
-
streamEventsForId
@GetMapping(value = {"/events/process/{processId}"}, produces = {"text/event-stream"}) final SseEmitter streamEventsForId(@PathVariable() String processId)
-
-
-
-