Skip to content

[Jetty] Added the Jetty v2 examples on three lanes. - #354

Draft
moetemp wants to merge 27 commits into
moe/jetty/v2/j3-workflow-readsfrom
moe/jetty/v2/j4-examples
Draft

moetemp wants to merge 27 commits into
moe/jetty/v2/j3-workflow-readsfrom
moe/jetty/v2/j4-examples

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds the three Jetty v2 examples to tests/contrib/streams/examples/ and lists them in the examples README.

two_backends.py: one Worker with RedisStreamPlugin and NativeStreamPlugin, a Workflow with an audit Stream on Redis and a live Stream on native, and one Activity that writes to both.
workflow_reader.py: a follower Workflow reads an agent Workflow's Stream with subscribe, until the Stream closes with the agent's result.
migrate_redis_to_native.py: step 1 runs the old code on Redis only. Step 2 deploys new code on a Worker with both plugins, which picks native behind workflow.patched, so a chat that started on Redis goes on there, and a new chat goes to the server.
test_examples.py runs each one on three lanes. The memory and Redis lanes use MemoryStreamPlugin(name="native") in place of the server, with no change to Workflow code. The native lane uses NativeStreamPlugin and runs only when TEMPORAL_STREAMS_NATIVE_TARGET names a server with the Stream service.

Why?

The examples show that the Brook v4 API extends to Workflow reads, the native backend, and two backends in one Worker with additions only, and they are the review material for Jetty v2.

How did you test it?

pytest tests/contrib/streams passes, with the examples on the memory and Redis lanes. The native lane passes against jt-srv's t5 dev server.
poe lint passes.

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