Class S3DispatchSubscriber
java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.S3DispatchSubscriber
Subscribes to the s3-connector's
StreamCrawlStatus for one crawl
and mirrors its state into a S3DispatchSubscriber.S3DispatchState the orchestrator's
wait loop reads each tick — the S3 counterpart of
JdbcDispatchSubscriber, but count-based: the connector reports
how many objects it dispatched (and, at COMPLETED, the final total)
rather than per-doc ids.
House pattern: blocking server-streaming iterator drained on a dedicated virtual thread; no Mutiny. The connector's stream has state-snapshot semantics (current state arrives immediately), so there is no subscribe race to defend against.
If the stream cannot be established (older connector without the
RPC, connector restarted and forgot the crawl), the state reports
S3DispatchSubscriber.S3DispatchState.unavailable() and the wait loop falls back to
its legacy stability gate — degraded, not broken.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classLive mirror of one crawl's connector-side state. -
Constructor Summary
ConstructorsConstructorDescriptionCreates the subscriber; its gRPC stub is injected and it is managed by CDI. -
Method Summary
Modifier and TypeMethodDescriptionOpen the status stream forrequestIdand drain it on a virtual thread.
-
Constructor Details
-
S3DispatchSubscriber
public S3DispatchSubscriber()Creates the subscriber; its gRPC stub is injected and it is managed by CDI.
-
-
Method Details
-
subscribe
Open the status stream forrequestIdand drain it on a virtual thread. Returns immediately; the returned state updates as responses arrive and stops changing once the stream ends.- Parameters:
requestId- the crawl request id whose status stream to subscribe to- Returns:
- a live state mirror that is updated by a background virtual thread as status responses arrive
-