Skip to content

[Brook S3] Added Stream definitions, handles, Records and errors to temporalio.common. - #373

Open
moetemp wants to merge 1 commit into
moe/brook/review/feature-streamsfrom
moe/brook/review/s3-data-model
Open

moetemp wants to merge 1 commit into
moe/brook/review/feature-streamsfrom
moe/brook/review/s3-data-model

Conversation

@moetemp

@moetemp moetemp commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What was changed

This PR adds the data model of the Streams API to temporalio.common. That's Stream definitions, handles, Records and errors.

  • A definition subclasses StreamDefinition[T] and has @common.defn. It gives a Stream its name and its one payload type.
  • A handle converts to the proto JSON of StreamRef, through the nested conversion of [Brook G2] Converted transfer types nested in JSON values. #368. So a Workflow can pass a Stream to an Activity, a child or the next run, and the type hint picks the handle class, such as ActivityStream[Turn].
  • Each error class maps a case of StreamErrorReason from the Stream protos.

It depends on #372 (the generated Stream bindings) and #368.

Why?

Every later Streams PR builds on these types, and they need no backend or server. Stream handles and big-payload handles discusses the handle's wire form.

One open question. temporalio.common gets its first __all__, which changes from temporalio.common import *. Is that OK?

Part of the Brook review series.

Checklist

  1. How was this tested:
    • tests/contrib/streams/test_handles.py, and test_vectors.py, which checks the ids and withdrawal rules against the temporalio-streams crate.

@moetemp moetemp added the skip-changelog Changelog entry rides another PR label Oct 25, 2026
@moetemp
moetemp force-pushed the moe/brook/review/feature-streams branch from 9e54468 to 4c0260b Compare October 26, 2026 00:14
@moetemp
moetemp force-pushed the moe/brook/review/s3-data-model branch 2 times, most recently from 347fb8d to 9e969ce Compare October 26, 2026 02:08
@moetemp
moetemp force-pushed the moe/brook/review/feature-streams branch 2 times, most recently from c4ce9d7 to c22d918 Compare October 26, 2026 08:44
@moetemp
moetemp force-pushed the moe/brook/review/s3-data-model branch 2 times, most recently from 9b54b39 to fda6c46 Compare October 27, 2026 09:07
@moetemp
moetemp force-pushed the moe/brook/review/feature-streams branch from 479a894 to 63423ea Compare October 27, 2026 09:17
@moetemp
moetemp force-pushed the moe/brook/review/s3-data-model branch 2 times, most recently from 5a0f9bf to 7a7e940 Compare October 28, 2026 01:33
@moetemp
moetemp force-pushed the moe/brook/review/feature-streams branch from 63423ea to 6a7f134 Compare October 28, 2026 01:33
They are the data model of the Streams API in `temporalio.common`. A
handle is data, so a Workflow can pass it to an Activity, a child or the
next run.
@moetemp
moetemp force-pushed the moe/brook/review/s3-data-model branch from 7a7e940 to cbec633 Compare October 28, 2026 07:54
@moetemp
moetemp force-pushed the moe/brook/review/feature-streams branch from 6a7f134 to 021a3b7 Compare October 28, 2026 07:54
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