Class RunRegistry.RunHandle
java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.RunRegistry.RunHandle
- Enclosing class:
RunRegistry
One run: its thread, journal, and subscribers. Obtain via
RunRegistry.start(RunPipelineCrawlRequest, BiConsumer) / RunRegistry.get(String).-
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTerminal(Duration wait) Block until the run reaches a terminal state.booleancancel()Request cancellation: interrupts the run thread.info()Summary snapshot of this run.booleanWhether the run has finished (successfully or not).runId()Registry id for this run.voidsubscribe(io.grpc.stub.StreamObserver<ai.pipestream.testing.harness.v1.RunPipelineCrawlResponse> subscriber) Attach a subscriber: full journal replay, then live tail, in order, with no gap (replay and appends share the handle lock).voidunsubscribe(io.grpc.stub.StreamObserver<ai.pipestream.testing.harness.v1.RunPipelineCrawlResponse> subscriber) Detach a subscriber (client went away).
-
Method Details
-
subscribe
public void subscribe(io.grpc.stub.StreamObserver<ai.pipestream.testing.harness.v1.RunPipelineCrawlResponse> subscriber) Attach a subscriber: full journal replay, then live tail, in order, with no gap (replay and appends share the handle lock). If the run is already terminal, the subscriber gets the replay followed immediately byonCompleted.- Parameters:
subscriber- where events go (SSE bridge or gRPC observer)
-
unsubscribe
public void unsubscribe(io.grpc.stub.StreamObserver<ai.pipestream.testing.harness.v1.RunPipelineCrawlResponse> subscriber) Detach a subscriber (client went away). The run does not care.- Parameters:
subscriber- previously passed tosubscribe(StreamObserver)
-
cancel
public boolean cancel()Request cancellation: interrupts the run thread. The orchestration maps the interrupt toRunInterrupted→ FAILED summary → ninja cleanup, so cancel is clean by construction.- Returns:
- true if a live thread was interrupted
-
awaitTerminal
Block until the run reaches a terminal state.- Parameters:
wait- how long to wait- Returns:
- true if terminal, false on timeout
- Throws:
InterruptedException- if interrupted while waiting
-
isTerminal
public boolean isTerminal()Whether the run has finished (successfully or not).- Returns:
- true once terminal
-
runId
-
info
-