Skip to content

Streams crate: combined branch for review - #228

Draft
moetemp wants to merge 7 commits into
moe/streams-crate-protosfrom
moe/brook/streams-combined
Draft

moetemp wants to merge 7 commits into
moe/streams-crate-protosfrom
moe/brook/streams-combined

Conversation

@moetemp

@moetemp moetemp commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

This PR adds a small temporalio-streams crate that runs the five Stream operations.

SDK users call the code that nexgen generates from the Stream WIT. The SDK hands each call to a Store as an operation name and an encoded request. So a lang bridge needs one Rust call, StreamRuntime::call(operation, request), which gives back the encoded response.

The crate has the Store trait, a memory Store, StreamRuntime, and shared test suites that each Store runs. A higher epoch of a Producer fences a lower one, and a batch with a sequence is written once. A Workflow Producer can't append, because a Workflow appends through its Local Activity. Stream and Producer ids are opaque text, and the runtime refuses only an empty id or one over 4096 bytes.

The base is the branch of temporalio#1733, which adds the Stream protos and WIT. The Redis Store is temporal-community/sdk-streams#8. The earlier, larger crate is kept at backup/pr-228-streams-combined-1112.

A Stream id and a Producer id are opaque bytes, since the caller builds both. The Store requires a
non-empty Producer id of at most 4096 bytes, and a kind.
A Store crate runs the suite on its own Store through `testing::TestStore`. The suite checks that a
Producer id is stored as bytes, also with a field separator in it.
A bridge calls `StreamRuntime::call` with an operation name and the encoded request. The read path,
the metrics and the shared service suite come with it, and the Store name is on each ref it builds.
@moetemp moetemp added the skip-changelog Changelog entry rides another PR label Nov 13, 2026
The fence of a Producer is kept by kind and id, so the id of a run-based kind must hold its run.
The shared suites now cover two runs, two kinds with one id, any text in an id and a close of each
kind, so every Store keeps these rules.
@moetemp
moetemp changed the base branch from moe/streams/restart-base to moe/streams-crate-protos November 13, 2026 06:42
The crate builds on the API files of the base branch, which follow temporalio/api#895 again.
The vendored Stream WIT follows temporalio/api#895, whose Workflow target omits append, close and
read.
The repo has no Python, so the script is now an example of the Stream crate. It is still a second
implementation, and it shares no code with the modules that the vector tests check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Changelog entry rides another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant