Skip to content

[Brook S9] Added the Stream examples and the end-to-end Redis tests. - #379

Closed
moetemp wants to merge 1 commit into
moe/brook/review/s8-activity-handlesfrom
moe/brook/review/s9-examples
Closed

moetemp wants to merge 1 commit into
moe/brook/review/s8-activity-handlesfrom
moe/brook/review/s9-examples

Conversation

@moetemp

@moetemp moetemp commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What was changed

This PR adds the Stream examples and the end-to-end Redis tests, the module doc of temporalio.streams, the Streams changelog fragment and a CODEOWNERS entry.

  • Each example follows the Python tab of its API proposal section, and runs as a test on both backends. The ids and task queues come from the test, so the runs don't share them.
  • In the UI backend and resume examples, a client creates the Stream and passes its ref to the Workflow. The reader gets it by id with client.get_stream[Turn](chat_id), and matches on r.kind, which narrows the item's type. Its read ends when the creator closes the Stream at the end of async with.
  • In the client example, the Workflow gets the ref as data, writes through workflow.to_stream(ref), and passes the same ref on to an Activity.
  • The agent example creates its two Streams under its session id, hands out the turns ref through a stream query that returns None before the create, and forwards both refs at continue-as-new. It publishes the done Turn with the reply, then closes, since a close carries no value.
  • The Activity example writes through activity.client().to_stream, and uses a fake model client in place of a model call. Its sync Activity is a method of a class that keeps the Worker's client, since a sync Activity has no activity.client().
  • The end-to-end tests cover Workflow and Activity writes to one Stream, replays that send no create again, codecs, eviction, retries, continue-as-new and two backends on one client.
  • worker_setup.py says that a Worker serves only one backend. Its test checks that a Worker on the migration's client with two backends raises StreamConfigError.
  • The changelog fragment covers the whole stack.

Why?

After this PR, feature-streams has the whole API. Upstream merges feature/streams into main once, so main never has half an API. The examples are the API docs until the docs site has Streams.

Open question. CODEOWNERS gives the AI SDK team and the SDK team the Streams paths, temporalio/streams/ included. Which team owns them?

Part of the Streams review series.

Checklist

  1. How was this tested:
    • poe lint, poe gen-docs, a regeneration that leaves no diff, the Streams suite on both backends with Redis, and the client, converter, bridge, Replayer, plugin and Nexus caller suites.

@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch from 55f7a0d to c4f1ffc Compare October 26, 2026 00:14
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 223a99b to fa0c9d3 Compare October 26, 2026 02:08
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch from c4f1ffc to ca1e58d Compare October 26, 2026 02:08
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from fa0c9d3 to 24f6a90 Compare October 26, 2026 04:13
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch 2 times, most recently from 3029be1 to ed9287d Compare October 26, 2026 04:52
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch 2 times, most recently from 79cf55a to 15eebd7 Compare October 26, 2026 08:44
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch 2 times, most recently from 0bb4d28 to ed58b77 Compare October 27, 2026 09:07
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 15eebd7 to b3da39a Compare October 27, 2026 09:07
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch from ed58b77 to 3afa400 Compare October 27, 2026 09:17
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from b3da39a to 212ef71 Compare October 27, 2026 09:17
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch 2 times, most recently from 98dc9dc to e237cb7 Compare October 28, 2026 07:54
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 0c7ec5b to 86d50a1 Compare October 28, 2026 08:05
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch from e237cb7 to 0bf1696 Compare October 28, 2026 08:05
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 7fd6dcb to ee23c91 Compare November 5, 2026 17:19
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch 2 times, most recently from b64ebb5 to d321f7a Compare November 5, 2026 23:10
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 0d2120b to b346382 Compare November 6, 2026 09:06
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch 2 times, most recently from 06f603e to f3ca1f0 Compare November 6, 2026 09:22
@moetemp
moetemp force-pushed the moe/brook/review/s8-activity-handles branch from 058106a to 1b71cf6 Compare November 6, 2026 10:11
@moetemp
moetemp force-pushed the moe/brook/review/s9-examples branch from f3ca1f0 to e7b444e Compare November 6, 2026 10:11
@moetemp

moetemp commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Closed in favor of #381, the combined branch, which has this change.

@moetemp moetemp closed this Nov 10, 2026
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