Repository navigation
Conversation
moetemp
force-pushed
the
moe/brook/review/feature-streams
branch
from
October 26, 2026 00:14
9e54468 to
4c0260b
Compare
moetemp
force-pushed
the
moe/brook/review/s3-data-model
branch
2 times, most recently
from
October 26, 2026 02:08
347fb8d to
9e969ce
Compare
moetemp
force-pushed
the
moe/brook/review/feature-streams
branch
2 times, most recently
from
October 26, 2026 08:44
c4ce9d7 to
c22d918
Compare
moetemp
force-pushed
the
moe/brook/review/s3-data-model
branch
2 times, most recently
from
October 27, 2026 09:07
9b54b39 to
fda6c46
Compare
moetemp
force-pushed
the
moe/brook/review/feature-streams
branch
from
October 27, 2026 09:17
479a894 to
63423ea
Compare
moetemp
force-pushed
the
moe/brook/review/s3-data-model
branch
2 times, most recently
from
October 28, 2026 01:33
5a0f9bf to
7a7e940
Compare
moetemp
force-pushed
the
moe/brook/review/feature-streams
branch
from
October 28, 2026 01:33
63423ea to
6a7f134
Compare
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
force-pushed
the
moe/brook/review/s3-data-model
branch
from
October 28, 2026 07:54
7a7e940 to
cbec633
Compare
moetemp
force-pushed
the
moe/brook/review/feature-streams
branch
from
October 28, 2026 07:54
6a7f134 to
021a3b7
Compare
…us`. The backend takes the close status from the failure, so a close only turns an asyncio cancel into Temporal's cancel failure. The Stream errors are the generated classes, with the same names. `StreamHandle` is the one handle type of every context, so `from_handle` is gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
This PR adds the data model of the Streams API to
temporalio.common. That's Stream definitions, theStreamHandle[T]data, Records, errors and the generated wire models that they carry.StreamDefinition[T]and has@common.defn. It gives a Stream its name and its one payload type.StreamHandle[T]is data only. It has the fields of thetemporal.api.stream.v1.StreamHandlewire model (id,ownerandbackend) and no calls. S5 addstemporalio.client.Stream, which makes the calls outside Workflow code, and S7 addstemporalio.workflow.WorkflowStream, which makes them in Workflow code.StreamHandlethrough nexgen's generated converter, also as a field of a dataclass or a pydantic model, through the nested conversion of [Brook G2] Converted transfer types nested in JSON values. #368. So a Workflow can pass a handle to an Activity, a child or the next run. The type argument, such asStreamHandle[Turn], is for type checks only.temporalio.commonalso exports the generated wire models that handles, Records,Supersededitems and errors carry:Execution,ExecutionType,Producer,ProducerEpoch,StreamErrorReason,StreamProducerKind,StreamSupersededandWorkflowTaskEpoch. So code outside the SDK can build a Workflow's handle.StreamErrorReason. They have nocode, andreasonis the generatedStreamErrorReasonIntEnum.StreamConfigErrorstays hand-written, since it isn't a Store reason.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, and why the handle is data with no calls.
One open question.
temporalio.commongets its first__all__, which changesfrom temporalio.common import *. Is that OK?Part of the Brook review series.
Checklist
tests/contrib/streams/test_handles.py, andtest_vectors.py, which checks the ids and withdrawal rules against thetemporalio-streamscrate.