Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
002f313
Added the Activity and client stream handles.
moetemp Oct 9, 2026
d9f18bd
Merged the stream reference kind widening into p3b-outside-handles.
moetemp Oct 9, 2026
76319e4
Merged the review fixes into p3b-outside-handles.
moetemp Oct 10, 2026
155118f
Included the scheduling run id in an Activity's stream producer id.
moetemp Oct 10, 2026
f15fb59
Merged the review fixes into p3b-outside-handles.
moetemp Oct 10, 2026
8608906
Marked records from an older attempt as stale.
moetemp Oct 10, 2026
324fee9
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
0aba928
Reached a Workflow's stream through Core's stream service.
moetemp Oct 11, 2026
fef09e2
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
342f31a
Said when a stream read starts and how not to miss the next record.
moetemp Oct 11, 2026
dfc3e2d
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
8983a7a
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
1b78954
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
67c3df7
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
9f22bca
Used the Workflow's codec context and one producer per topic.
moetemp Oct 11, 2026
14ba29a
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
fe7aa4f
Merged p3a-workflow-writer into p3b-outside-handles.
moetemp Oct 11, 2026
518434e
Merged p3a into p3b.
moetemp Oct 13, 2026
a59caa4
Merged p3a into p3b.
moetemp Oct 13, 2026
58f6416
Merged p3a into p3b.
moetemp Oct 13, 2026
9895084
Merged p3a into p3b.
moetemp Oct 13, 2026
1557fcd
Added a changelog entry for Workflow streams.
moetemp Oct 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/added/pirouetting-platypus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental `temporalio.contrib.streams` so a Workflow can publish ordered records to a Redis stream with its Workflow Task, and Activities and clients can read them.
19 changes: 19 additions & 0 deletions temporalio/contrib/streams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
context then reaches a stream the same way:

- Workflow code publishes to its own stream with :func:`workflow_writer`.
- An Activity reaches the stream of the Workflow that scheduled it with
:func:`activity_handle`, and writes as itself: its Activity id with the
scheduling run id, and its Temporal attempt. The handle is pinned to that
run, so a read on it ends when the run closes, Continue-as-New included.
- Any process holding a client reaches a Workflow's stream with
:func:`get_stream_handle`, and writes with a producer id and an attempt of
its own.

The stored record is ``temporal.sdk.streams.v1.StreamRecord``, in
:mod:`temporalio.bridge.proto.streams.v1`, with the user's value in ``body``
Expand All @@ -57,6 +64,13 @@
StreamStorageError,
StreamUnsupportedError,
)
from temporalio.contrib.streams._handles import (
ActivityStreamHandle,
StreamHandle,
StreamProducer,
activity_handle,
get_stream_handle,
)
from temporalio.contrib.streams._plugin import StreamStorePlugin
from temporalio.contrib.streams._record import (
Cursor,
Expand All @@ -69,6 +83,7 @@
from temporalio.contrib.streams._workflow import WorkflowStreamWriter, workflow_writer

__all__ = [
"ActivityStreamHandle",
"BEGINNING",
"Cursor",
"DEFAULT_TOPIC",
Expand All @@ -78,9 +93,11 @@
"StreamCursorError",
"StreamError",
"StreamExpiredError",
"StreamHandle",
"StreamNotFoundError",
"StreamOutcomeUnknownError",
"StreamOwnerKind",
"StreamProducer",
"StreamProducerError",
"StreamRecord",
"StreamRecordError",
Expand All @@ -92,6 +109,8 @@
"StreamUnsupportedError",
"Supersession",
"WorkflowStreamWriter",
"activity_handle",
"get_stream_handle",
"topic",
"workflow_writer",
]
Loading
Loading