Repository navigation
Conversation
A Workflow read that gives each Record as it arrives must return its object at once, with no await. That object is a class that the support package writes by hand, so only a helper method returns it.
Workflow code reads each Record as it arrives, then reads where and why the read ended. The support package gets a small test double of the reading, so the tests run with no Store.
Authors need the `sync` argument of `@nexus.helper` and the new alias directive for a support class. The changelog notes both for the Python support package. Co-authored-by: Tim Conley <timothy.conley@temporal.io>
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.
This PR lets a
@nexus.helpermethod return at once, and lets it return a class of the support package.sync=trueon@nexus.helpermakes the Python method a plaindef. It returns the helper's result with noawait.@nexus.support-type python="<class>"on a type alias stands for a class that the support package exports.@nexus.genericon the alias gives its type parameters. nexgen generates nothing for the class, and only a helper method may return it.The Workflow
Streamgets a read that gives each Record as it arrives. Code iterates the result, and then reads from it where and why the read ended. So the method must hand back an object with noawait, and that object has behavior, which a generated model can't have.The stream sample has the new method on its Workflow
Stream. TypeScript, .NET, Go and Java leave it out, as they do for every helper method, so their sample outputs don't change.