Skip to content

[Brook] Removed the old Stream API. - #346

Closed
moetemp wants to merge 17 commits into
moe/brook/v4/p23-stream-clientfrom
moe/brook/v4/p24-remove-old-api
Closed

moetemp wants to merge 17 commits into
moe/brook/v4/p23-stream-clientfrom
moe/brook/v4/p24-remove-old-api

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR removes the old Stream API and moves the tests to the new one.

Gone are the default Stream, the Stream header on Activities, workflow_stream, create_workflow_stream, activity_stream, for_handle, for_ref, the module create_stream, StreamRef, OutsideStream, Topic and Idle. The writer has no buffered publish path any more, since each awaited publish is one WriteRecords call and BufferedPublisher batches in Python. The package docstring describes the backend names: each plugin registers one with name= (redis, memory), a handle carries it, default=True picks a client's default, and for now a Worker takes one Stream plugin, so it serves one backend. backend_of_client goes, since nothing uses it.

The live tests that used the old API now run on the new one: one Stream for a Workflow and its Activity, a failed Workflow Task, the last run that closes a Stream it did not write, a cancelled block, sandbox passthrough, a Local Activity's epoch, a retry run, the payload codec, replay on a new Worker, Worker and plugin shutdown, eviction, the owner on Workflow calls, a final failure under a retry policy, and a missing capability. A reader that wants to stop after a quiet time now sets its own timer.

Why?

S62 and S74: no default Stream, no Stream header on Activities, and one entry point per context.

How did you test it?

pytest tests/contrib/streams on the memory Store and on a scratch redis-server, against the stock dev server. test_vectors skips the crate's cases with no Stream name. pyright, mypy, basedpyright, pydocstyle, ruff.

  • Unit Tests
  • Staging
  • End to End Tests

…emove-old-api

# Conflicts:
#	temporalio/contrib/streams/__init__.py
#	temporalio/contrib/streams/_access.py
#	temporalio/contrib/streams/_outside.py
#	temporalio/contrib/streams/_reader.py
#	temporalio/contrib/streams/_stream.py
#	temporalio/contrib/streams/_workflow.py
#	tests/contrib/streams/test_activity_handles.py
#	tests/contrib/streams/test_facade.py
#	tests/contrib/streams/test_redis.py
#	tests/contrib/streams/test_workflow_module.py
…emove-old-api

# Conflicts:
#	temporalio/contrib/streams/_activity.py
#	tests/contrib/streams/test_activity_handles.py
@moetemp

moetemp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This layer is folded into the v5 tip, #365, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f

@moetemp moetemp closed this Oct 25, 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