Skip to content

feat: add the Stream runtime API with stubbed calls - #1762

Closed
moetemp wants to merge 2 commits into
moe/streams-crate-protosfrom
moe/streams-runtime-api
Closed

moetemp wants to merge 2 commits into
moe/streams-crate-protosfrom
moe/streams-runtime-api

Conversation

@moetemp

@moetemp moetemp commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

This PR adds the top-level API of the temporalio-streams runtime, with every call stubbed.

A bridge builds one StreamRuntime per client. The runtime has one typed method for each call, and dispatch.rs has their byte forms for a bridge. StreamRuntime::call takes a method name and the encoded request, and gives back the encoded response or a StreamError. So a bridge decodes no proto, and the Stream logic stays in this crate. sdk-python's bridge does this in temporalio/bridge/src/streams.rs.

Method of call Request Response
CreateStream CreateStreamRequest CreateStreamResponse
AppendRecords AppendRecordsRequest AppendRecordsResponse
CloseStream CloseStreamRequest CloseStreamResponse
ReadRecords ReadRecordsRequest ReadRecordsResponse
DescribeStream DescribeStreamRequest DescribeStreamResponse

A writer is an object that the bridge holds. Dropping it releases it, so no call names a writer by an id.

Writer call Request Response
StreamRuntime::open_writer_bytes OpenWriterRequest a StreamWriter
StreamWriter::write_bytes WriteRecordsRequest WriteRecordsResponse
StreamWriter::close_bytes none CloseWriterResponse
  • The five methods of call are the Stream service operations. The writer messages are the runtime's own, in coresdk.streams.
  • Every call fails with Reason::Unsupported. A byte call decodes its request first, so a request that doesn't decode fails with Reason::Invalid.
  • StreamRuntime::new takes a Store, which is an empty trait here. MemoryStreamRuntime builds a runtime for tests from a MemoryStreamConfig, which this PR adds to streams.proto.

Why?

The review of #1733 asked to see the top-level Core API that uses the messages before anything merges into a branch. The PRs on top of this one fill the stubs, from the Store trait to the writers, and none of them changes a public signature in runtime.rs.

Checklist

  1. How was this tested:
    • Unit tests that each byte call decodes its request first, and of the answers to an unknown method and a bad memory config. Also cargo clippy and cargo doc with warnings as errors.

@moetemp
moetemp force-pushed the moe/streams-runtime-api branch 6 times, most recently from b6c43fb to 4bcd0eb Compare November 11, 2026 17:45
A bridge calls the runtime's typed methods or their byte form, and holds each writer as an object. Each byte call decodes its request, and every call fails with Unsupported, so the API comes before the Store and the logic of the calls.
The read and describe docs of the stubs named items and the Retention, which the API removed.
@moetemp
moetemp force-pushed the moe/streams-runtime-api branch from 4bcd0eb to 4c8120b Compare November 12, 2026 09:51
@moetemp moetemp closed this Nov 13, 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