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)
  • Method Details

    • publish

      void publish(String runId, Progress event)
      Broadcast event to every subscriber registered for runId. 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

      ProgressSink.Subscription subscribe(String runId, Consumer<Progress> listener)
      Register listener for events on runId. The returned ProgressSink.Subscription must 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