Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions changelog/added/amentiferous-refugia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Core: Experimental: the stream wakes the server puts on a Workflow Task's scheduled event reach the SDK as job 17, `WorkflowTaskAttachments`, one `Any(StreamWake)` per attachment. Replay delivers the same attachments in the same activations. A task scheduled with attachments ends a workflow task heartbeat chain, so it keeps an activation of its own on replay. A heartbeat fold that would reach the live task ends at the last completed task.
Core: Experimental: `Success.heartbeat_task` on a workflow activation completion asks Core to complete the workflow task now while local activities run, as at a local activity heartbeat. The task carries the commands and markers so far and asks for a new task. Core ignores the flag while replaying, since the SDK sets it from a count or a clock.
9 changes: 9 additions & 0 deletions changelog/added/drowsy-dormouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Experimental `temporalio.contrib.streams`: a Worker built from a client that carries a stream store waits, when it stops, for up to 10 seconds for the stream notifications the stream runtime still has out. `StreamStorePlugin.flush_notifications()` does the same for a process that holds only a client.
Experimental `temporalio.contrib.streams`: a store tells each stream's notifier on the server when the stream moves, after every append, and the append answers only after its notification went. It is on by default, and `StreamStorePlugin.notify_on_append(False)` turns it off. `StreamHandle.close()` and `StreamStorePlugin.close_stream()` close a stream with a result or an `error=`, which reaches every reader that sleeps on the stream.
Experimental `temporalio.contrib.streams`: an idle `StreamHandle.read()` sleeps on the stream's notifier on the server instead of holding a store read open. After `idle_wait` (2 seconds by default) with no record it waits for a notification or the close, and reads again at the server's wait limit. On a server without the notifier it waits in the store as before.
Experimental `temporalio.contrib.streams`: a `StreamHandle.read()` of a topic closed with `error=` raises that error after the last record.
Experimental `temporalio.contrib.streams`: `workflow_reader()` reads a stream in Workflow code, one Local Activity per batch, with every record kind including `SUPERSEDED`. An idle reader sleeps on the stream's notifier with no Local Activity and no timer, and `position` lets the next run resume after Continue-as-New. It needs a server with the stream notifier and Workflow wake target.
Experimental `temporalio.contrib.streams`: a `workflow_reader()` ends its Workflow Task after 100 commands or 2 seconds by default (`TaskCutoff`), so a busy reader doesn't hold back the Workflow's other work. It asks Core to complete the task through the new `heartbeat_task` flag while its read runs on.
Experimental `temporalio.contrib.streams`: `close_workflow_stream(topic, result=, error=)` closes a Workflow's own stream from Workflow code. The run's `FINISH` goes with the activation, and the Worker appends it before it starts the Local Activity that closes the store and the stream's notifier, so every reader ends and sleeping readers see the outcome.
Experimental `temporalio.contrib.streams`: `StreamClosedError.closed_by` names who closed the stream. After a failed Workflow Task, the stream runtime drops the rerun's records on a topic the run closed itself.
Experimental `temporalio.contrib.streams`: `workflow_reader()` records each read's range and digest in History in place of its records by default, and replay reads the range from the store again before Workflow code sees it. `replay_from_store=False` records each batch in History instead. Other records fail the Workflow Task as nondeterministic, and a lost range fails it for a retry with `StreamReplayRangeLostError`. `RedisStreams` takes `floor_lease` and `floor_release_grace`.
1 change: 1 addition & 0 deletions changelog/added/ringing-heron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Experimental `temporalio.contrib.streams`: a `workflow_reader()` reads first and attaches to the stream's notifier only when a read comes back empty, then reads once more with no wait before it sleeps.
3 changes: 3 additions & 0 deletions changelog/added/standalone-heron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Experimental `temporalio.contrib.streams`: a standalone Activity owns a stream. In a standalone Activity, `activity_handle()` is the Activity's own stream, and it writes as `<Activity id>@<run id>`. `StreamRef.for_activity` opens it, a read ends when the Activity run ends, and `delete_activity_streams` deletes it.
Experimental `temporalio.contrib.streams`: `start_activity_with_stream` starts an Activity that owns a stream of its own. The Worker closes the stream when the Workflow sees the Activity end, and the server's notifier closes it after its graces when that close never comes.
Experimental `temporalio.contrib.streams`: an Activity's producer attempt is `started_unix_ms << 11 | min(attempt, 2047)`, from the time the server started the attempt and its Temporal attempt. A retry and an attempt after a reset start later, so they supersede the earlier attempt, and the key fits 53 bits.
2 changes: 1 addition & 1 deletion temporalio/bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion temporalio/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ url = "2.2"
# makes it use the submodule's crates, so the bridge sees one `Connection` type.
[dependencies.temporalio-streams]
git = "https://github.com/moetemp/sdk-streams"
rev = "16592b73e5fa198c6f35cfbf22368fe566cca793"
rev = "b7637ed8e25abade941c89bc6c3139671a6fcb72"
default-features = false
features = ["envconfig", "redis"]

Expand Down
2 changes: 1 addition & 1 deletion temporalio/bridge/proto/streams/streams_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading