Repository navigation
Conversation
This was referenced Oct 28, 2026
moetemp
force-pushed
the
moe/up/python-client-target
branch
2 times, most recently
from
October 30, 2026 00:00
4d12251 to
dd3e142
Compare
moetemp
force-pushed
the
moe/up/python-poll
branch
2 times, most recently
from
October 30, 2026 01:00
8cdaab3 to
c00d700
Compare
moetemp
force-pushed
the
moe/up/python-client-target
branch
from
October 30, 2026 01:00
dd3e142 to
df29fb0
Compare
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 30, 2026 07:14
c00d700 to
de33837
Compare
moetemp
changed the base branch from
moe/up/python-client-target
to
moe/fix/api-generation-targets-review
October 30, 2026 07:14
moetemp
force-pushed
the
moe/fix/api-generation-targets-review
branch
from
October 30, 2026 08:06
a5c7270 to
4875677
Compare
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 30, 2026 08:06
de33837 to
17f6c9a
Compare
moetemp
force-pushed
the
moe/fix/api-generation-targets-review
branch
from
October 30, 2026 23:00
4875677 to
4660b19
Compare
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 30, 2026 23:00
17f6c9a to
3e1ca29
Compare
Base automatically changed from
moe/fix/api-generation-targets-review
to
refactor/api-generation-targets
October 30, 2026 23:28
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 30, 2026 23:44
3e1ca29 to
7efc328
Compare
moetemp
changed the base branch from
refactor/api-generation-targets
to
moe/up/python-workflow-package
October 30, 2026 23:45
The poll helper names the support function that builds the next request. Only the client target gets an iterator, so the parser refuses a poll without `target="client"` and a poll on a resource method.
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 31, 2026 03:11
7efc328 to
26b2571
Compare
moetemp
changed the base branch from
moe/up/python-workflow-package
to
refactor/api-generation-targets
October 31, 2026 03:11
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 31, 2026 03:17
26b2571 to
6938695
Compare
A WIT stream can't cross a Nexus call, so a read is a request and a response. The iterator reads every page. The extension creates one Nexus client for the iteration, and a handle uses its own client. Co-authored-by: Tim Conley <timothy.conley@temporal.io>
moetemp
force-pushed
the
moe/up/python-poll
branch
from
October 31, 2026 03:18
6938695 to
f2cc4b8
Compare
The Stream service sets `next_offset` on an empty page too, so the helper reads it as the Stream reader does. Each answer's next offset sets the later reads, also after `start` or `last`.
A caller that changes a yielded page then can't change the next read. `AsyncGenerator` lets a caller close the iterator with `aclose()` or `contextlib.aclosing`. A handle's iterator also gets the method doc and `Args:`.
The poll directive then reads its targets as the other directives do. A refused poll gives the service, the operation and the input path.
Also rewrite poll comments that read two ways or use `name` as a verb.
A generic directive check is planned for syntax and placement. The kept fixtures cover the client-only rule, an operation shape the iterator can't take, and an iterator name clash.
The full stream helper is in the sample, so the guide keeps a short version and links to it.
moetemp
marked this pull request as ready for review
October 31, 2026 04:57
This was referenced Oct 31, 2026
This branch has not been deployed
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.pollto the Python client target. An operation with@nexus.poll python="<helper>" targets="client"gets aniter_<name>async iterator. It yields each response and asks the support package's<helper>(request, response)for the next request, which returnsNoneto stop.iter_<name>, and so does each client resource method that binds the operation. The stream sample getsiter_read_recordsandStream.iter_read. Its helper ends a read that doesn't wait at the newest Record, and starts each later read at the last page'snext_offset.targets, withtargetsthat includeworkflow, on a resource method, and on an operation it can't poll. The Workflow package doesn't change.Why?
A WIT stream can't cross a Nexus call, so the Stream read is a request and a response. The iterator reads every page, and the support package decides the next request.
How did you test it?
Link to a test plan if any -
test_stream_client.pyreads every page throughclient.iter_read_recordsand throughStream.iter_read, ends a read that doesn't wait at the newest Record, and starts the read afterstart=ENDat the first page's offset. Rejection fixtures cover the client-only rule, an operation that returns a resource, and an iterator name clash.