Repository navigation
Conversation
Owner
Author
|
Closing as stale. This layer is folded into the v5 tip, #41, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f |
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 declares the Stream handle in
crates/streams/nexus/stream-service.witas a WIT resource with methods.resource streamis built from itsstream-ref(constructor(stream: stream-ref)), so the ref stays the handle's serialized form. It has four methods:append-records,close,read-recordsanddescribe. Each takes its request without thestreamfield, and names its operation with@nexus.operation "<operation>", so nexgen fills in the ref from the handle.create-streamreturnscreate-stream-result, a record mapped toCreateStreamResponsethat holdsown<stream>withcreatedandstatus, since the facade needsstatus. The singlestreamfield binds by name to thestreamfield of each request and of the create response. The handle and its methods carry@nexus.doclines.The Stream service proto gets the standard API language options (
go_package,csharp_namespaceand the others), so nexgen can map its wire types in Go and .NET. The proto messages, the@nexus.protomappings and the operation names on the wire are unchanged, so the server and the crate don't change.tests/wit.rschecks the resource and its bindings.Why?
Decision S84: Tim asked in the 2026-10-21 meeting that
stream_handle.publishcome from a resource in the IDL, not from hand-written sugar. With moetemp/nexgen#45, the generated Python is aStreamclass withappend_records,close,read_records,iter_read_recordsanddescribe, andcreate_streamreturns aStream.With moetemp/nexgen#45, the long poll on
read-recordsalso givesiter_read_records, an async iterator over the Records (decision S85, no WITstream<T>). The handle stays an immutable identity value (decision S86). moetemp/nexgen#45 gives the reasons for both.Open for Tim: none left here. The create result, the docs, reads (S85) and handle state (S86) are settled, and moetemp/nexgen#45 gives the reasons.
How did you test it?
cargo test --test witincrates/streams, andcargo fmt --all --check. The sdk-python Stream bindings generated from this WIT with moetemp/nexgen#45 passpyrightwith 0 errors.Stacked on #31 (
moe/brook/v4/s15-wit-docs-and-no-interval).