Repository navigation
Conversation
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 27, 2026 07:35
6c8e944 to
4fea886
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 27, 2026 08:17
26765fa to
d18c6dc
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 27, 2026 08:17
4fea886 to
3f46160
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 27, 2026 16:55
d18c6dc to
018e21d
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 27, 2026 16:55
f89e58b to
03e0fad
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 27, 2026 23:46
018e21d to
be4d7ae
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 27, 2026 23:46
03e0fad to
7bb4e72
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 28, 2026 08:55
be4d7ae to
95ed97c
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 28, 2026 08:55
7bb4e72 to
53631bb
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 29, 2026 04:06
53631bb to
b5e1532
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 29, 2026 08:37
0922872 to
b163ba2
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
2 times, most recently
from
October 29, 2026 09:17
23f4638 to
d27b78f
Compare
Each SDK copies it and generates its client with nexgen's client target. SDKs call the writer methods with `runtime.proto` messages, so there's no writer WIT.
The close request has a status of its own, an enum apart from the stream's status. As a param, the caller sets it, and nothing fills it from the stream.
The read item binds the API's `StreamRecord.item` oneof as a variant, and the error reason binds the new enum. The resource methods take the names users call, and each request lists its required fields first, so the generated models stay positional.
A create of a closed, expired or other-owned Stream fails, so the handle no longer takes a create status. The read method takes `last` and `max-bytes`, which the request has.
The generated Stream API is the user API. The directives hide the fields that the runtime sets, make the Stream generic in its value type, and shape publish, read and close. A read item is optional, so a reader can skip an item kind that it doesn't know.
Replay needs a fixed range, so the Workflow API omits `last`, and the resource `read` no longer takes it. nexgen renamed the error enum's `base` keys to `name` and `extends`. The `max-records` doc says that a Superseded item stays with its Record, as the proto does.
moetemp
force-pushed
the
moe/brook/review/streams-k10-wit
branch
from
October 29, 2026 10:03
d27b78f to
88adfdf
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k9-writers
branch
from
October 29, 2026 10:03
83b33d1 to
56fd065
Compare
The SDK Stores ignore failed-tasks and previous-completed-task on a close, as they do withdraw-run.
nexgen's TypeScript and .NET client targets build the read iterator from these support helpers.
The close drops status, which the failure gives. An append with no sequence gets the next one from the Store, so publish works.
Owner
Author
|
Closing. The Stream service WIT moved to temporalio/api#895. |
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 changed?
This PR adds the Stream service WIT, the input of each SDK's nexgen client.
stream-service.witis a System Nexus service. There's no writer WIT. SDKs call the writer methods withruntime.protomessages, so no SDK generates writer bindings with nexgen.stream-ref.owneris anexecutionrecord.stream-itemis a variant bound to A1'sStreamRecord.itemoneof, with the casesdata,supersededandclose.stream-error-reasonbinds A1's error enum.%streamis required, and so are the lists. Each record lists its required fields first, so the generated Python models stay positional, with nokw_only.publish,read,closeanddescribe, the names users call.@nexus.operationkeeps the wire names.close-with-run, and the close'sfailed-tasksandprevious-completed-task, are@nexus.omit, like the other native-only fields.moetemp/sdk-streams#52, it follows the reworked nexgen.ReadRecordsuses@nexus.poll, andcreate-streamreturns thestreamresource withcreatedon it.readtakesmax-bytes, which the request has. Only the client'sread-recordstakeslast, since Workflow replay needs a fixed range.moetemp/nexgen#78to#97, so the generated Stream API is the user API.Streamis generic in its value typebody-t, and a create takes aStreamDefinition. The fields that the runtime sets have a@nexus.sourceper target, or@nexus.api-omit. The create and the handle factory takeidandbackend, not the ref.publish(*values)returns the last offset. The read poll yields each Record and resumes after the last one,async withcloses the Stream, and each error reason with a class raises that class.CANCELEDfor a failure withCanceledFailureInfo.Depends on #219 (K9), but needs only #212 (K1). Review lane is the proto and WIT reviewers.
Part of the Brook review series.
Why?
The WIT is only a nexgen input, so it's last and alone. After review the crate ships with the sdk-rust crates. sdk-python moves its pin to this PR's head in its coming repin.
How did you test it?
cargo fmt,cargo clippy -- -D warnings(with and without features),cargo test -p temporalio-streams --all-featuresandcargo docpass at this commit.nexgen at
moetemp/nexgen#97(c88f90ef) generates the WIT for Python, TypeScript and .NET.