Skip to content

feat: add the StreamStore trait and the Stream runtime to temporalio-streams - #1799

Closed
moetemp wants to merge 0 commit into
moe/streams-crate-typesfrom
moe/streams-crate
Closed

moetemp wants to merge 0 commit into
moe/streams-crate-typesfrom
moe/streams-crate

Conversation

@moetemp

@moetemp moetemp commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

This PR adds the StreamStore trait and the Stream runtime to the temporalio-streams crate. It is experimental, and Core's Worker gets no Stream code.

  • StreamStore has the five operations of the Stream service (create, append, read, close and describe) and the limits of one batch. A bridge implements it for a Store that is written in its language.
  • StreamRuntime checks each request, calls the Store, and checks the answer. Core calls it in feat: let Core append to and close a Stream for Workflow code #1801.

The checks are the same for every Store.

  • A Stream id and a Producer id have 1 to 4096 bytes.
  • A Workflow Producer gives its Workflow Task as the epoch.
  • A batch is within the limits of its Store. They are at most 1000 Records and 4 MiB for a batch, and 1536 KiB for a Record.
  • A read gives at most 1000 Records, and the Store waits at most 60 s.
  • The offsets of a page rise, start after from_offset, and end at or before last_offset. A bad answer fails with Reason::StorageCorrupt.

The Store does the rest. It fences a lower epoch of a Producer, and it writes a batch that comes again once.

Why?

Core and each SDK bridge need one Store interface and one set of checks. The Stores are in temporal-community/sdk-streams#9.

Checklist

  1. How was this tested:

    • cargo test -p temporalio-streams. The tests of the runtime use a Store that gives the answers that a test set.
  2. Any docs updates needed?

    • No. The crate has its own README.md.

@moetemp
moetemp added this pull request to stack #1800 November 14, 2026 06:07
@moetemp
moetemp force-pushed the moe/streams-crate-protos branch from 0b34794 to 3319ba8 Compare November 16, 2026 15:21
@moetemp
moetemp removed this pull request from stack #1800 November 16, 2026 16:57
@moetemp
moetemp force-pushed the moe/streams-crate-protos branch from b0bd538 to 7727bdf Compare November 17, 2026 08:35
@moetemp
moetemp added this pull request to stack #1812 November 17, 2026 20:51
@moetemp
moetemp removed this pull request from stack #1812 November 17, 2026 22:01
@moetemp
moetemp force-pushed the moe/streams-crate-protos branch 2 times, most recently from 50a0871 to 77a456b Compare November 18, 2026 07:50
@moetemp
moetemp changed the base branch from moe/streams-crate-protos to moe/streams-crate-types November 18, 2026 17:21
@moetemp moetemp changed the title feat: add temporalio-streams, the Stream runtime that SDK bridges link feat: add the StreamStore trait and the Stream runtime to temporalio-streams Nov 18, 2026
@moetemp
moetemp added this pull request to stack #1818 November 18, 2026 18:05
@moetemp
moetemp force-pushed the moe/streams-crate-types branch from b543267 to dc75996 Compare November 18, 2026 18:10
@moetemp moetemp closed this Nov 18, 2026
@moetemp

moetemp commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #1817, so the crate lands with its Store trait and runtime in one PR.

@moetemp
moetemp removed this pull request from stack #1818 November 18, 2026 20:21
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