Package com.tnsai.reliability
Interface ProgressSink
- All Known Implementing Classes:
InMemoryProgressSink
public interface ProgressSink
Pub/sub surface for
Progress events emitted during a
ResumableRun (TNS-299).
Implementations vary by deployment shape: an in-memory sink for tests and single-process workloads; a Kafka / NATS sink for fan-out to dashboards and alerting. The contract is intentionally minimal — publish + subscribe-with-handle — so adapters can use whatever underlying transport fits.
Concurrency
Implementations MUST be safe to call concurrently. The orchestrator publishes from its execution thread; subscribers may register and cancel from arbitrary threads (operator dashboards, test harnesses).- Since:
- 0.10.0 (TNS-299)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHandle returned fromsubscribe(java.lang.String, java.util.function.Consumer<com.tnsai.reliability.Progress>). -
Method Summary
-
Method Details
-
publish
Broadcasteventto every subscriber registered forrunId. Returns once delivery has been queued — does not block on slow subscribers (implementations decide their queueing / back-pressure strategy).- Throws:
NullPointerException- if any arg is null
-
subscribe
Registerlistenerfor events onrunId. The returnedProgressSink.Subscriptionmust be cancelled when the consumer is done; not cancelling leaks subscriber state.The listener may be invoked concurrently with itself for different events — implementations don't serialize calls.
- Throws:
NullPointerException- if any arg is null
-