Repository navigation
Conversation
The Stream WIT no longer marks any operation one-way, so the parser, generator, tests, docs and changelog fragment go.
Owner
Author
|
Reverted out of the stack. The Stream WIT doesn't use |
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
@nexus.one-wayon WIT operations. In Python, both Workflow stubs (_<op>(request)and the keyword form) become synchronous and returnNone. Each stub still callsnexus_client.start_operation(...), so the call goes through every outbound interceptor, and then drives the start coroutine once withsend(None). When an interceptor takes the call and completes it without suspending, the stub returns. When the start suspends, the stub closes it and raisesRuntimeError.TypeScript and .NET accept the directive and keep their async stubs. The directive is refused with arguments, with
@nexus.long-poll, with@nexus.output-transform, or on an operation that returns a resource. Python refuses a one-way operation with generic models or function fields.Why?
publishis synchronous in Workflow code, and today each facade must start the async stub as a background task. A Brook plugin buffersAppendRecordsandCloseStreamin its outbound interceptor and returns a done handle, so the start never suspends.How did you test it?
tests/wit_streaming.rschecks the stub shape and the refusals. The new Python tests fail on #37. I also ran a live check on a dev server withtemporalio1.34.0: a Workflow calls the stub three times with an outbound interceptor that records the call and returns at once, and it completes with three calls taken. Without the interceptor the Workflow Task fails with the stub's message.Stacked on
moe/brook/v3/n0-base, which merges #30 to #35 ontomain. The branch merges each of them again when it changes. The only conflict is the union of the tests that #31 and #33 append totests/generate_python.rs.