Skip to content

Release v0.17.0 - #457

Merged
conradbzura merged 9 commits into
masterfrom
release
Dec 2, 2026
Merged

conradbzura merged 9 commits into
masterfrom
release

Conversation

@wool-labs

@wool-labs wool-labs Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Auto-generated by the cut release workflow.

wool-labs Bot and others added 9 commits November 4, 2026 19:17
The pool created its proxy at context entry and dropped the reference,
keeping only the context manager. Nothing could route a call through a
pool named by its receiver without a handle on the proxy serving it.

Bind the proxy the factory yields to the pool for the lifetime of the
context, and clear it in a finally so a failed exit leaves no handle
behind. Behavior is unchanged; the ambient dispatch path still resolves
its proxy from the caller's context.
A routine call dispatches through whichever pool is ambient in the
caller's context. Naming a pool instead required either entering it or
accepting the keyword collision that kept executor out of
wool.to_thread: a pool keyword would silently shadow any routine
parameter of the same name.

Express the choice through the receiver. WorkerPool.dispatch takes the
routine positionally and reserves no keyword, so every keyword reaches
the routine. One routine goes to one worker, selected by the pool's
load balancer, and the task carries that pool's proxy, so the nested
calls the routine makes route through it as well.

The routine layer gains the seam this needs. Each decorated wrapper
carries a dispatch entrypoint matching its call shape, and
dispatch_through routes one call through a proxy its caller names
rather than the ambient one. The attribute's absence is what rejects an
undecorated callable, which is a rejection the explicit path needs
because it is handed a callable rather than invoking one: an
undecorated coroutine function is callable and awaitable, so it would
run in the caller's own process while the call reported a dispatch.

A bound method or classmethod carries its receiver out of band, where
an ambient call carries it in the argument list. Unbinding on the way
through restores the ambient shape, so obj.method takes the same
arguments dispatched as it does called.
Add the explicit-dispatch section to the package README, and correct
the worker README's note on concurrent pool entry, which described
every dispatch path as binding a context variable. WorkerPool.dispatch
binds nothing, threading the retained proxy to the routine layer
explicitly, so it never raises ChainContention.
The docstring had three structural defects alongside its prose ones.
Its summary line was nominal rather than imperative; the bulk of its
prose sat after the field list, where the documented section order puts
only examples and the implementation rubric; and it still carried the
legacy role markup that new prose is not to introduce.

Reorder to summary, prose, field list, examples, rubric. Replace the
two interleaved note directives and the six-item best-practices list
with named subsections that separate what the process boundary
guarantees from what it constrains, collapsing the three items that
were advice or restated parity into the claims carrying them. Convert
the role markup to the single-backtick convention. No contract claim
is dropped.
Drive the dispatch cases through the proxy boundary and assert on the
public task fields, so the suite exercises the real dispatch entrypoint
rather than a patched stand-in, and the bound-callable contract becomes
observable at this level.

The stream relay was the gap worth closing. A dispatched async
generator relays its result stream without calling asend until the
consumer sends a value, and nothing reached that guard through the
pool: replacing it with an unconditional asend passed the entire suite.
A stream implementing no asend now fails that mutation.
Exercise the override against live workers: a call routed to the
receiver while another pool is ambient, the ambient pool restored
afterwards and after a stream is abandoned mid-iteration, concurrent
dispatches isolated under gather, nested calls following the task's
proxy, the generator protocol forwarded end to end, an exception
propagated from the routine, and the routine running under the
caller's chain.
The explicit path routes through WorkerProxy.dispatch, so every
composition axis the matrix varies is live for it, and none was
covering it: transport credentials, discovery, pool mode, channel
limits, backpressure and the context-var patterns.

Add explicit coroutine and async generator shapes to the routine
dimension, following the convention the nested shapes already set of
naming a dispatch path rather than a callable shape. Extract the
generator step driver so the ambient and explicit arms share it
instead of duplicating the per-yield assertions. The pairwise filter
and the Hypothesis strategy already admit every binding for a shape
that pins none, so the two stay in agreement untouched.
@conradbzura
conradbzura merged commit ca709b2 into master Dec 2, 2026
17 checks passed
@wool-labs
wool-labs Bot deleted the release branch December 2, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant