Skip to content

[Jetty] Added the stream notifier archetype. - #51

Draft
moetemp wants to merge 2 commits into
moe/jetty/js2-callback-progressfrom
moe/jetty/js3-stream-notifier
Draft

moetemp wants to merge 2 commits into
moe/jetty/js2-callback-progressfrom
moe/jetty/js3-stream-notifier

Conversation

@moetemp

@moetemp moetemp commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds the stream notifier, a CHASM execution per stream that holds its readers' callbacks.

  • chasm/lib/streamnotifier keys a notifier by workflow/<id>/<first run>/<topic>, so one notifier serves the stream across a run chain.
  • Attach is idempotent and capped by streamnotifier.maxCallbacks. Notify keeps the highest counter and hands it to every callback as progress. Close completes them all.
  • A closed notifier answers late attaches for streamnotifier.closedRetention (7 days).
  • The first-run check at attach takes the first run of any chain of the Workflow id. So a reader of an earlier chain still attaches after the id was reused.
  • An owner check every streamnotifier.ownerCheckInterval closes the stream when the owner chain ended, after streamnotifier.ownerCloseGrace.
  • It's behind streamnotifier.enabled, off by default.

It carries moetemp/temporal#41. Attach still keeps the operation token and start time (DD-70). A Nexus callback takes only the completion here, since its progress delivery stays in Bridge.

Why?

A notifier keyed by the stream survives worker restarts and works for every producer kind (DD-31). An owner that ended closes the stream (DD-73, DD-108).

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

Unit tests in chasm/lib/streamnotifier, and the functional TestStreamNotifier* tests on CHASM and HSM callers.

A Nexus callback takes only the completion here, since no progress delivery reaches it yet.
@moetemp moetemp mentioned this pull request Oct 14, 2026
2 of 3 tasks
The first-run check compared only with the current chain, so it refused readers of a chain
that ended before the Workflow ID was reused. A first run of an earlier chain is taken too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant