Compare commits
No commits in common. "c62f93a8fb8158809118ce7ba17b10610b338d95" and "2a59cefbe80ae770b4c0bec074eeb51d07cfb0be" have entirely different histories.
c62f93a8fb
...
2a59cefbe8
|
|
@ -367,94 +367,9 @@ user's failing-test-first convention). The poll-based reap
|
||||||
fix in `_supervise.py` is UNCOMMITTED and likely SUPERSEDED
|
fix in `_supervise.py` is UNCOMMITTED and likely SUPERSEDED
|
||||||
by the re-scoping — do NOT land it as-is.
|
by the re-scoping — do NOT land it as-is.
|
||||||
|
|
||||||
## RESOLVED (2026-07-06): migrate everything, remove the API
|
|
||||||
|
|
||||||
The PAUSED re-assessment concluded decisively: rather than
|
|
||||||
re-scope `_reap_ria_portals` (or bolt any hack onto it), the
|
|
||||||
`run_in_actor()` API itself was REMOVED — its non-blocking
|
|
||||||
"result at teardown" semantic predates streaming and confused
|
|
||||||
more than it served. Every in-repo caller was migrated
|
|
||||||
per-file/-group (each its own commit, each gated):
|
|
||||||
|
|
||||||
- tests: `test_infected_asyncio` `test_runtime` `test_rpc`
|
|
||||||
`test_spawning` `test_pubsub` `test_registrar`
|
|
||||||
`test_cancellation` (3 groups) `test_advanced_streaming`.
|
|
||||||
- examples: 4 non-debugging + all 8 `debugging/` REPL scripts
|
|
||||||
(debugger suite byte-identical green, 28p/6s).
|
|
||||||
- docs: 8 rst pages + the `experimental/_pubsub` docstring.
|
|
||||||
|
|
||||||
Migration patterns (the `run_in_actor` shape -> successor):
|
|
||||||
|
|
||||||
- blocking result -> `to_actor.run(fn, an=an, ...)`
|
|
||||||
- fire-&-forget/forever -> bg `to_actor.run()` task in a local
|
|
||||||
`trio` task-nursery (or `start_actor`
|
|
||||||
+ bg `Portal.run()` when a portal
|
|
||||||
handle is needed)
|
|
||||||
- concurrent fan-out -> N bg `to_actor.run()` tasks / or
|
|
||||||
`gather_contexts([p.open_context(..)])`
|
|
||||||
- reap-all-error-collect -> the "collect don't cancel" pattern:
|
|
||||||
each one-shot catches + stashes its
|
|
||||||
`RemoteActorError`, group raised
|
|
||||||
after the task-nursery joins (see
|
|
||||||
`examples/debugging/multi_subactors.py`)
|
|
||||||
- mutual-rendezvous -> peers must OUTLIVE both dialogs:
|
|
||||||
`start_actor()` daemons + concurrent
|
|
||||||
`Portal.run()`s + explicit
|
|
||||||
`an.cancel()` (eager one-shot reap
|
|
||||||
races the slower peer's dial of the
|
|
||||||
winner's dead sockaddr; found via
|
|
||||||
`test_trynamic_trio` flake).
|
|
||||||
|
|
||||||
Semantic deltas (tests loosened accordingly):
|
|
||||||
|
|
||||||
- teardown-reap-all BEG-of-N is GONE: local task-nurseries are
|
|
||||||
cancel-on-first, raced siblings' `Cancelled`s are absorbed,
|
|
||||||
and the runtime's `collapse_eg()` unwraps every single-member
|
|
||||||
group at each actor boundary — a fully-raced nested tree
|
|
||||||
relays a bare (annotated) `RemoteActorError` chain.
|
|
||||||
- `test_multierror_fast_nursery` deleted (pure reap-stress);
|
|
||||||
`test_nested_multierrors` re-purposed as deep-tree
|
|
||||||
cancel-cascade stress w/ a race-tolerant shape walk.
|
|
||||||
|
|
||||||
Final excision (after zero callers remained): `run_in_actor()`,
|
|
||||||
`._cancel_after_result_on_exit`, `_reap_ria_portals()`,
|
|
||||||
`Portal._submit_for_result/._expect_result_ctx/
|
|
||||||
.wait_for_result()/.result()`, `exhaust_portal()`,
|
|
||||||
`cancel_on_completion()`, `NoResult` — net -402 lines. The
|
|
||||||
reap-hang class (unbounded `wait_for_result` in machinery
|
|
||||||
scope) dissolves structurally: the only result-wait left lives
|
|
||||||
in the caller's task inside its own cancel-scope; the
|
|
||||||
`d1fb4a1a` anti-hang guard test passes by construction. The
|
|
||||||
poll-vs-`proc_waiter` debate is moot as predicted.
|
|
||||||
|
|
||||||
## Follow-up sketch: `to_actor.open_one_shot()` (run-async parity)
|
|
||||||
|
|
||||||
If deferred-result parity is ever wanted, the design that needs
|
|
||||||
NO runtime coupling, NO returned `Portal` and NO cancel-relay
|
|
||||||
`trio.Event` machinery:
|
|
||||||
|
|
||||||
async with to_actor.open_one_shot(
|
|
||||||
fn, an=an, **kws,
|
|
||||||
) as one_shot:
|
|
||||||
... # concurrent caller work
|
|
||||||
val = await one_shot.wait() # optional; errors always
|
|
||||||
# propagate at scope exit
|
|
||||||
|
|
||||||
an `@acm` that opens a private task-nursery, `start_soon`s ONE
|
|
||||||
task running the existing blocking `run()` and stashes the
|
|
||||||
value in a slot + sets a done-`trio.Event` (a memo, not a
|
|
||||||
cancel relay). Cancellation = plain scope-cancel of the acm's
|
|
||||||
nursery (the parked `Portal.run()` unwinds via `Cancelled`, the
|
|
||||||
shielded `cancel_actor()` reap still runs); a child error
|
|
||||||
raises into the acm scope so an un-`wait()`ed one-shot can
|
|
||||||
never silently drop its error. i.e. the old reaper's job is
|
|
||||||
done by scoping, not machinery. ~40 lines, all in
|
|
||||||
`to_actor/_api.py`, zero `_supervise` involvement.
|
|
||||||
|
|
||||||
## Verification gate
|
## Verification gate
|
||||||
|
|
||||||
- per-migration-commit module gates on `trio` (+ `mp_spawn`
|
- `tests/test_cancellation.py test_spawning.py test_local.py
|
||||||
spot-gates incl. `test_infected_asyncio` per the B2 lesson);
|
test_rpc.py` on `trio` + `mp_spawn` + `mp_forkserver`
|
||||||
`tests/devx/test_debugger.py` for the REPL flows.
|
backends, then full suite; `tests/devx/test_debugger.py`
|
||||||
- full suite on `trio` + `mp_spawn` at branch tip + CI matrix
|
for risk 3.
|
||||||
via draft PR #484.
|
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
---
|
|
||||||
model: claude-fable-5
|
|
||||||
service: claude
|
|
||||||
session: 6db64ac6-6986-4505-9343-df4ee31e67db
|
|
||||||
timestamp: 2026-07-06T17:28:18Z
|
|
||||||
git_ref: ad42871e
|
|
||||||
scope: code
|
|
||||||
substantive: true
|
|
||||||
raw_file: 20260706T172818Z_ad42871e_prompt_io.raw.md
|
|
||||||
---
|
|
||||||
|
|
||||||
## Prompt
|
|
||||||
|
|
||||||
Resuming the `drop_ria_nursery` (wkt) branch after the human's
|
|
||||||
review pause at `ba4af0ad`, with the directive:
|
|
||||||
|
|
||||||
> we need to resolve the remaining outstandings ... to finish
|
|
||||||
> this endeavour we ideally,
|
|
||||||
> - finish the ria-tn hoist into the machinery in `to_actor` if
|
|
||||||
> possible.
|
|
||||||
> - avoid supporting the `.run_in_actor()` non-blocking API
|
|
||||||
> going forward other then if we can re-wrap `to_actor.run()`
|
|
||||||
> per prior discussion with opus4.8.
|
|
||||||
> - get the test harness completely green locally and in CI -
|
|
||||||
> AND ESPECIALLY without any hangs due to the "the old
|
|
||||||
> spawn-backend reaper raced `soft_kill()`'s scope-cancel"
|
|
||||||
> - update all docs to reflect these changes once we're happy.
|
|
||||||
|
|
||||||
plus mid-flight additions:
|
|
||||||
|
|
||||||
> make sure both all the test and example code uses the naming
|
|
||||||
> `an: ActorNursery` for variable names
|
|
||||||
|
|
||||||
> where we at in terms of a potential hackaround design for
|
|
||||||
> supporting a to_actor.run_async() ... without requiring the
|
|
||||||
> same malarky ... with a `trio.Event` relay ... i'm totes fine
|
|
||||||
> with rejigging the iface to NOT return a Portal as well.
|
|
||||||
|
|
||||||
## Response summary
|
|
||||||
|
|
||||||
Completed the entire #477 `run_in_actor` removal on
|
|
||||||
`drop_ria_nursery` (16 commits this session), gated per-commit:
|
|
||||||
|
|
||||||
- ported the remaining `test_cancellation` groups
|
|
||||||
(`some_cancels_all`, `nested_multierrors`+`spawn_and_error`,
|
|
||||||
SIGINT + sync-sleep) — one-shots become concurrent
|
|
||||||
`to_actor.run()` tasks in local task-nurseries; BEG-shape
|
|
||||||
assertions loosened for cancel-on-first + the runtime's
|
|
||||||
`collapse_eg()` single-member unwrap (a fully-raced nested
|
|
||||||
tree relays a bare annotated `RemoteActorError` chain).
|
|
||||||
- fixed a pre-existing `UnboundLocalError` (`timeout` `match`
|
|
||||||
had no default arm for non-trio/MTF backends).
|
|
||||||
- ported `test_dynamic_pub_sub`, 4 non-debugging examples, all
|
|
||||||
8 `debugging/` examples (debugger suite byte-identical,
|
|
||||||
28p/6s; `multi_subactors` introduces the "collect don't
|
|
||||||
cancel" reap-all replacement pattern), 8 docs pages + the
|
|
||||||
`experimental/_pubsub` docstring.
|
|
||||||
- EXCISED the API + cluster: `run_in_actor`,
|
|
||||||
`_reap_ria_portals`, `_cancel_after_result_on_exit`,
|
|
||||||
`Portal._submit_for_result/_expect_result_ctx/
|
|
||||||
wait_for_result/result`, `exhaust_portal`,
|
|
||||||
`cancel_on_completion`, `NoResult` — net -402 lines. The
|
|
||||||
reap-hang class dissolves structurally (result-waits now only
|
|
||||||
in caller task-scope).
|
|
||||||
- found + fixed a real migration race: mutual-rendezvous peers
|
|
||||||
(`test_trynamic_trio`, `a_trynamic_first_scene.py`) flaked
|
|
||||||
because an eagerly-reaped one-shot dies while its peer still
|
|
||||||
dials the registry-resolved (dead) sockaddr — such peers now
|
|
||||||
pin lifetimes via `start_actor()` + concurrent `Portal.run()`
|
|
||||||
+ explicit `an.cancel()`.
|
|
||||||
- `an: ActorNursery` naming sweep across tests/examples (±82
|
|
||||||
lines, scoped renames, prose untouched).
|
|
||||||
- parked a `to_actor.open_one_shot()` design sketch (acm +
|
|
||||||
private task-nursery over blocking `run()`; done-Event as
|
|
||||||
memo not cancel-relay; no Portal) in the plan doc.
|
|
||||||
|
|
||||||
## Files changed
|
|
||||||
|
|
||||||
See commits `d01a2123..ad42871e` on `drop_ria_nursery`
|
|
||||||
(tests, examples, docs, `tractor/{runtime,spawn,to_actor,msg}`
|
|
||||||
+ `_exceptions/_context/experimental`).
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
---
|
|
||||||
model: claude-fable-5
|
|
||||||
service: claude
|
|
||||||
timestamp: 2026-07-06T17:28:18Z
|
|
||||||
git_ref: ad42871e
|
|
||||||
diff_cmd: git diff ba4af0ad..ad42871e
|
|
||||||
---
|
|
||||||
|
|
||||||
# Raw AI output (diff-ref mode)
|
|
||||||
|
|
||||||
This session's output spans the 16 migration/excision commits
|
|
||||||
`d01a2123..ad42871e` on `drop_ria_nursery`; per diff-ref mode
|
|
||||||
the verbatim content is reachable via the pointer below.
|
|
||||||
|
|
||||||
## Generated files
|
|
||||||
|
|
||||||
> `git diff ba4af0ad..ad42871e`
|
|
||||||
|
|
||||||
Commit-wise (each `Gate:`-footed msg documents its own module
|
|
||||||
gate):
|
|
||||||
|
|
||||||
- `d01a2123` port `test_some_cancels_all`
|
|
||||||
- `697c6152` fix unbound `timeout` (non-trio/MTF `match` arm)
|
|
||||||
- `fa8799d5` port `test_nested_multierrors`
|
|
||||||
- `f11754ce` port SIGINT + sync-sleep cancel tests
|
|
||||||
- `cb6202e3` port `test_dynamic_pub_sub`
|
|
||||||
- `d8af5f12` port non-debugging examples
|
|
||||||
- `a3057cb2` port debugging examples (+ `test_debugger`
|
|
||||||
nested-nurseries final-shape expectations)
|
|
||||||
- `d6bed7c4` port docs (8 rst pages)
|
|
||||||
- `07e1669e` fix stale `@pub` docstring example
|
|
||||||
- `2a59cefb` REMOVE `run_in_actor()` + the ria reap cluster
|
|
||||||
(net -402 lines)
|
|
||||||
- `a297a32a` fix mutual-rendezvous premature-reap race
|
|
||||||
- `ad42871e` `an: ActorNursery` naming sweep
|
|
||||||
|
|
||||||
Plan/design record updated in
|
|
||||||
`ai/conc-anal/ria_nursery_removal_plan.md` (RESOLVED section +
|
|
||||||
the `to_actor.open_one_shot()` follow-up sketch).
|
|
||||||
|
|
@ -17,37 +17,36 @@ async def say_hello(other_actor):
|
||||||
return await portal.run(hi)
|
return await portal.run(hi)
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def run_and_print(
|
||||||
"""Main tractor entry point, the "master" process (for now
|
an: tractor.ActorNursery,
|
||||||
acts as the "director").
|
name: str,
|
||||||
"""
|
other_actor: str,
|
||||||
async with tractor.open_nursery() as an:
|
):
|
||||||
print("Alright... Action!")
|
|
||||||
|
|
||||||
# both actors wait on (then dial!) the *other*, so each
|
|
||||||
# must outlive both hellos: spawn as daemons, run the
|
|
||||||
# hellos concurrently, reap only once both complete.
|
|
||||||
portals: dict[str, tractor.Portal] = {
|
|
||||||
name: await an.start_actor(
|
|
||||||
name,
|
|
||||||
enable_modules=[__name__],
|
|
||||||
)
|
|
||||||
for name in ('donny', 'gretchen')
|
|
||||||
}
|
|
||||||
|
|
||||||
async def run_and_print(name: str, other_actor: str):
|
|
||||||
print(
|
print(
|
||||||
await portals[name].run(
|
await tractor.to_actor.run(
|
||||||
say_hello,
|
say_hello,
|
||||||
|
an=an,
|
||||||
|
name=name,
|
||||||
|
# arguments are always named
|
||||||
other_actor=other_actor,
|
other_actor=other_actor,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
async with trio.open_nursery() as tn:
|
|
||||||
tn.start_soon(run_and_print, 'donny', 'gretchen')
|
|
||||||
tn.start_soon(run_and_print, 'gretchen', 'donny')
|
|
||||||
|
|
||||||
await an.cancel()
|
async def main():
|
||||||
|
"""Main tractor entry point, the "master" process (for now
|
||||||
|
acts as the "director").
|
||||||
|
"""
|
||||||
|
async with (
|
||||||
|
tractor.open_nursery() as an,
|
||||||
|
trio.open_nursery() as tn,
|
||||||
|
):
|
||||||
|
print("Alright... Action!")
|
||||||
|
|
||||||
|
# both actors wait on the *other* to register so their
|
||||||
|
# one-shots must run concurrently.
|
||||||
|
tn.start_soon(run_and_print, an, 'donny', 'gretchen')
|
||||||
|
tn.start_soon(run_and_print, an, 'gretchen', 'donny')
|
||||||
|
|
||||||
print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...")
|
print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ async def movie_theatre_question():
|
||||||
async def main():
|
async def main():
|
||||||
"""The main ``tractor`` routine.
|
"""The main ``tractor`` routine.
|
||||||
"""
|
"""
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'frank',
|
'frank',
|
||||||
# enable the actor to run funcs from this current module
|
# enable the actor to run funcs from this current module
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ async def stream_forever() -> AsyncIterator[int]:
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'donny',
|
'donny',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ async def name_error():
|
||||||
async def spawn_error():
|
async def spawn_error():
|
||||||
""""A nested nursery that triggers another ``NameError``.
|
""""A nested nursery that triggers another ``NameError``.
|
||||||
"""
|
"""
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
return await tractor.to_actor.run(
|
return await tractor.to_actor.run(
|
||||||
name_error,
|
name_error,
|
||||||
an=an,
|
an=n,
|
||||||
name='name_error_1',
|
name='name_error_1',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ async def name_error():
|
||||||
async def spawn_error():
|
async def spawn_error():
|
||||||
""""A nested nursery that triggers another ``NameError``.
|
""""A nested nursery that triggers another ``NameError``.
|
||||||
"""
|
"""
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
return await tractor.to_actor.run(
|
return await tractor.to_actor.run(
|
||||||
name_error,
|
name_error,
|
||||||
an=an,
|
an=n,
|
||||||
name='name_error_1',
|
name='name_error_1',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ async def main() -> None:
|
||||||
|
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
) as an:
|
) as n:
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'ctx_child',
|
'ctx_child',
|
||||||
|
|
||||||
# XXX: we don't enable the current module in order
|
# XXX: we don't enable the current module in order
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@ async def die():
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as tn:
|
||||||
|
|
||||||
debug_actor = await an.start_actor(
|
debug_actor = await tn.start_actor(
|
||||||
'debugged_boi',
|
'debugged_boi',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
)
|
)
|
||||||
crash_boi = await an.start_actor(
|
crash_boi = await tn.start_actor(
|
||||||
'crash_boi',
|
'crash_boi',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
# debug_mode=True,
|
# debug_mode=True,
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ async def main():
|
||||||
tractor.open_nursery(
|
tractor.open_nursery(
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
# loglevel='debug' # ?XXX required?
|
# loglevel='debug' # ?XXX required?
|
||||||
) as an,
|
) as n,
|
||||||
trio.open_nursery() as tn,
|
trio.open_nursery() as tn,
|
||||||
):
|
):
|
||||||
# spawn the actor..
|
# spawn the actor..
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'key_error',
|
'key_error',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,10 @@ async def cancelled_before_pause(
|
||||||
async def main():
|
async def main():
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
) as an:
|
) as n:
|
||||||
await tractor.to_actor.run(
|
await tractor.to_actor.run(
|
||||||
cancelled_before_pause,
|
cancelled_before_pause,
|
||||||
an=an,
|
an=n,
|
||||||
)
|
)
|
||||||
|
|
||||||
# ensure the same works in the root actor!
|
# ensure the same works in the root actor!
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ async def main():
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
enable_transports=[tpt],
|
enable_transports=[tpt],
|
||||||
loglevel='devx',
|
loglevel='devx',
|
||||||
) as an:
|
) as n:
|
||||||
p = await an.start_actor(
|
p = await n.start_actor(
|
||||||
'bp_boi',
|
'bp_boi',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ async def main():
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
debug_mode=True,
|
debug_mode=True,
|
||||||
loglevel='cancel',
|
loglevel='cancel',
|
||||||
) as an:
|
) as n:
|
||||||
|
|
||||||
# parks awaiting a result which only arrives once the
|
# parks awaiting a result which only arrives once the
|
||||||
# user quits (`BdbQuit`s) the child's REPL loop.
|
# user quits (`BdbQuit`s) the child's REPL loop.
|
||||||
await tractor.to_actor.run(
|
await tractor.to_actor.run(
|
||||||
breakpoint_forever,
|
breakpoint_forever,
|
||||||
an=an,
|
an=n,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ async def trio_to_aio_echo_server(
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
p = await an.start_actor(
|
p = await n.start_actor(
|
||||||
'aio_server',
|
'aio_server',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
infect_asyncio=True,
|
infect_asyncio=True,
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ async def main() -> None:
|
||||||
))
|
))
|
||||||
await proc.wait()
|
await proc.wait()
|
||||||
# await trio.sleep_forever()
|
# await trio.sleep_forever()
|
||||||
# async with tractor.open_nursery() as an:
|
# async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
# portal = await an.start_actor(
|
# portal = await n.start_actor(
|
||||||
# 'rpc_server',
|
# 'rpc_server',
|
||||||
# enable_modules=[__name__],
|
# enable_modules=[__name__],
|
||||||
# )
|
# )
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ async def worker_pool(workers=4):
|
||||||
Yes, the workers stay alive (and ready for work) until you close
|
Yes, the workers stay alive (and ready for work) until you close
|
||||||
the context.
|
the context.
|
||||||
"""
|
"""
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as tn:
|
||||||
|
|
||||||
portals = []
|
portals = []
|
||||||
snd_chan, recv_chan = trio.open_memory_channel(len(PRIMES))
|
snd_chan, recv_chan = trio.open_memory_channel(len(PRIMES))
|
||||||
|
|
@ -65,7 +65,7 @@ async def worker_pool(workers=4):
|
||||||
# this starts a new sub-actor (process + trio runtime) and
|
# this starts a new sub-actor (process + trio runtime) and
|
||||||
# stores it's "portal" for later use to "submit jobs" (ugh).
|
# stores it's "portal" for later use to "submit jobs" (ugh).
|
||||||
portals.append(
|
portals.append(
|
||||||
await an.start_actor(
|
await tn.start_actor(
|
||||||
f'worker_{i}',
|
f'worker_{i}',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -80,10 +80,10 @@ async def worker_pool(workers=4):
|
||||||
async def send_result(func, value, portal):
|
async def send_result(func, value, portal):
|
||||||
await snd_chan.send((value, await portal.run(func, n=value)))
|
await snd_chan.send((value, await portal.run(func, n=value)))
|
||||||
|
|
||||||
async with trio.open_nursery() as tn:
|
async with trio.open_nursery() as n:
|
||||||
|
|
||||||
for value, portal in zip(sequence, itertools.cycle(portals)):
|
for value, portal in zip(sequence, itertools.cycle(portals)):
|
||||||
tn.start_soon(
|
n.start_soon(
|
||||||
send_result,
|
send_result,
|
||||||
worker_func,
|
worker_func,
|
||||||
value,
|
value,
|
||||||
|
|
@ -98,7 +98,7 @@ async def worker_pool(workers=4):
|
||||||
yield _map
|
yield _map
|
||||||
|
|
||||||
# tear down all "workers" on pool close
|
# tear down all "workers" on pool close
|
||||||
await an.cancel()
|
await tn.cancel()
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|
|
||||||
|
|
@ -7,17 +7,17 @@ async def assert_err():
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
real_actors = []
|
real_actors = []
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
real_actors.append(await an.start_actor(
|
real_actors.append(await n.start_actor(
|
||||||
f'actor_{i}',
|
f'actor_{i}',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
))
|
))
|
||||||
|
|
||||||
# run one one-shot task actor that will fail immediately;
|
# run one one-shot task actor that will fail immediately;
|
||||||
# its error raises right here in the caller's task..
|
# its error raises right here in the caller's task..
|
||||||
await tractor.to_actor.run(assert_err, an=an)
|
await tractor.to_actor.run(assert_err, an=n)
|
||||||
|
|
||||||
# ..as a ``RemoteActorError`` containing an ``AssertionError``
|
# ..as a ``RemoteActorError`` containing an ``AssertionError``
|
||||||
# and all the other actors have been cancelled
|
# and all the other actors have been cancelled
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ async def simple_rpc(
|
||||||
|
|
||||||
async def main() -> None:
|
async def main() -> None:
|
||||||
|
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'rpc_server',
|
'rpc_server',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,9 @@ async def test_reg_then_unreg(
|
||||||
|
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
) as an:
|
) as n:
|
||||||
|
|
||||||
portal = await an.start_actor('actor', enable_modules=[__name__])
|
portal = await n.start_actor('actor', enable_modules=[__name__])
|
||||||
uid = portal.channel.aid.uid
|
uid = portal.channel.aid.uid
|
||||||
|
|
||||||
async with tractor.get_registry(reg_addr) as aportal:
|
async with tractor.get_registry(reg_addr) as aportal:
|
||||||
|
|
@ -62,7 +62,7 @@ async def test_reg_then_unreg(
|
||||||
# XXX: can we figure out what the listen addr will be?
|
# XXX: can we figure out what the listen addr will be?
|
||||||
assert sockaddrs
|
assert sockaddrs
|
||||||
|
|
||||||
await an.cancel() # tear down nursery
|
await n.cancel() # tear down nursery
|
||||||
|
|
||||||
await trio.sleep(0.1)
|
await trio.sleep(0.1)
|
||||||
assert uid not in aportal.actor._registry
|
assert uid not in aportal.actor._registry
|
||||||
|
|
@ -89,9 +89,9 @@ async def test_reg_then_unreg_maddr(
|
||||||
|
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[maddr_str],
|
registry_addrs=[maddr_str],
|
||||||
) as an:
|
) as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'actor_maddr',
|
'actor_maddr',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -105,7 +105,7 @@ async def test_reg_then_unreg_maddr(
|
||||||
sockaddrs = actor._registry[uid]
|
sockaddrs = actor._registry[uid]
|
||||||
assert sockaddrs
|
assert sockaddrs
|
||||||
|
|
||||||
await an.cancel()
|
await n.cancel()
|
||||||
|
|
||||||
await trio.sleep(0.1)
|
await trio.sleep(0.1)
|
||||||
assert uid not in aportal.actor._registry
|
assert uid not in aportal.actor._registry
|
||||||
|
|
@ -152,37 +152,27 @@ async def test_trynamic_trio(
|
||||||
for the directed subs.
|
for the directed subs.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
async with tractor.open_nursery() as an:
|
async with (
|
||||||
|
tractor.open_nursery() as n,
|
||||||
|
trio.open_nursery() as tn,
|
||||||
|
):
|
||||||
print("Alright... Action!")
|
print("Alright... Action!")
|
||||||
|
|
||||||
# donny + gretchen each wait on (then dial!) the *other*, so
|
# donny + gretchen each wait on the *other* to register, so
|
||||||
# both actors must OUTLIVE both hellos: spawn as daemons and
|
# they must run CONCURRENTLY — schedule both one-shots into a
|
||||||
# only reap after both tasks complete. NB a pair of eagerly
|
# local task-nursery (was two non-blocking `run_in_actor()`s).
|
||||||
# reaped `to_actor.run()` one-shots races: the first to
|
|
||||||
# finish dies while the other may still be dialing its
|
|
||||||
# registry-resolved (now dead) sockaddr -> conn-refused.
|
|
||||||
portals: dict[str, tractor.Portal] = {
|
|
||||||
name: await an.start_actor(
|
|
||||||
name,
|
|
||||||
enable_modules=[__name__],
|
|
||||||
)
|
|
||||||
for name in ('donny', 'gretchen')
|
|
||||||
}
|
|
||||||
|
|
||||||
async def _direct(this_name: str, other_actor: str):
|
async def _direct(this_name: str, other_actor: str):
|
||||||
res = await portals[this_name].run(
|
res = await tractor.to_actor.run(
|
||||||
ria_fn,
|
ria_fn,
|
||||||
|
an=n,
|
||||||
other_actor=other_actor,
|
other_actor=other_actor,
|
||||||
reg_addr=reg_addr,
|
reg_addr=reg_addr,
|
||||||
|
name=this_name,
|
||||||
)
|
)
|
||||||
print(res)
|
print(res)
|
||||||
|
|
||||||
async with trio.open_nursery() as tn:
|
|
||||||
tn.start_soon(_direct, 'donny', 'gretchen')
|
tn.start_soon(_direct, 'donny', 'gretchen')
|
||||||
tn.start_soon(_direct, 'gretchen', 'donny')
|
tn.start_soon(_direct, 'gretchen', 'donny')
|
||||||
|
|
||||||
# both hellos have completed; reap the thespians.
|
|
||||||
await an.cancel()
|
|
||||||
print("CUTTTT CUUTT CUT!!?! Donny!! You're supposed to say...")
|
print("CUTTTT CUUTT CUT!!?! Donny!! You're supposed to say...")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ def test_dynamic_pub_sub(
|
||||||
tractor.open_nursery(
|
tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
debug_mode=debug_mode,
|
debug_mode=debug_mode,
|
||||||
) as an,
|
) as n,
|
||||||
# bg-schedules the forever-streaming
|
# bg-schedules the forever-streaming
|
||||||
# one-shots below; the user-cancel raise
|
# one-shots below; the user-cancel raise
|
||||||
# cancels them all, each reaping its
|
# cancels them all, each reaping its
|
||||||
|
|
@ -237,7 +237,7 @@ def test_dynamic_pub_sub(
|
||||||
partial(
|
partial(
|
||||||
tractor.to_actor.run,
|
tractor.to_actor.run,
|
||||||
publisher,
|
publisher,
|
||||||
an=an,
|
an=n,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -249,7 +249,7 @@ def test_dynamic_pub_sub(
|
||||||
partial(
|
partial(
|
||||||
tractor.to_actor.run,
|
tractor.to_actor.run,
|
||||||
consumer,
|
consumer,
|
||||||
an=an,
|
an=n,
|
||||||
name=f'consumer_{sub}',
|
name=f'consumer_{sub}',
|
||||||
subs=[sub],
|
subs=[sub],
|
||||||
)
|
)
|
||||||
|
|
@ -260,7 +260,7 @@ def test_dynamic_pub_sub(
|
||||||
partial(
|
partial(
|
||||||
tractor.to_actor.run,
|
tractor.to_actor.run,
|
||||||
consumer,
|
consumer,
|
||||||
an=an,
|
an=n,
|
||||||
name='consumer_dynamic',
|
name='consumer_dynamic',
|
||||||
subs=list(_registry.keys()),
|
subs=list(_registry.keys()),
|
||||||
)
|
)
|
||||||
|
|
@ -370,10 +370,10 @@ def test_reqresp_ontopof_streaming():
|
||||||
timeout = 4
|
timeout = 4
|
||||||
|
|
||||||
with trio.move_on_after(timeout):
|
with trio.move_on_after(timeout):
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
# name of this actor will be same as target func
|
# name of this actor will be same as target func
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'dual_tasks',
|
'dual_tasks',
|
||||||
enable_modules=[__name__]
|
enable_modules=[__name__]
|
||||||
)
|
)
|
||||||
|
|
@ -436,9 +436,9 @@ def test_sigint_both_stream_types():
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
with trio.fail_after(timeout):
|
with trio.fail_after(timeout):
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
# name of this actor will be same as target func
|
# name of this actor will be same as target func
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'2_way',
|
'2_way',
|
||||||
enable_modules=[__name__]
|
enable_modules=[__name__]
|
||||||
)
|
)
|
||||||
|
|
@ -551,8 +551,8 @@ def test_local_task_fanout_from_stream(
|
||||||
|
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
debug_mode=debug_mode,
|
debug_mode=debug_mode,
|
||||||
) as an:
|
) as tn:
|
||||||
p: tractor.Portal = await an.start_actor(
|
p: tractor.Portal = await tn.start_actor(
|
||||||
'inf_streamer',
|
'inf_streamer',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ def test_remote_error(
|
||||||
async def main():
|
async def main():
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
) as an:
|
) as nursery:
|
||||||
|
|
||||||
# `to_actor.run()` blocks on the one-shot's result and
|
# `to_actor.run()` blocks on the one-shot's result and
|
||||||
# raises the remote error directly here in the caller's
|
# raises the remote error directly here in the caller's
|
||||||
|
|
@ -135,7 +135,7 @@ def test_remote_error(
|
||||||
try:
|
try:
|
||||||
await tractor.to_actor.run(
|
await tractor.to_actor.run(
|
||||||
assert_err,
|
assert_err,
|
||||||
an=an,
|
an=nursery,
|
||||||
name='errorer',
|
name='errorer',
|
||||||
**args
|
**args
|
||||||
)
|
)
|
||||||
|
|
@ -248,16 +248,16 @@ def test_cancel_single_subactor(
|
||||||
'''
|
'''
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
) as an:
|
) as nursery:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await nursery.start_actor(
|
||||||
'nothin', enable_modules=[__name__],
|
'nothin', enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
assert (await portal.run(do_nothing)) is None
|
assert (await portal.run(do_nothing)) is None
|
||||||
|
|
||||||
if mechanism == 'nursery_cancel':
|
if mechanism == 'nursery_cancel':
|
||||||
# would hang otherwise
|
# would hang otherwise
|
||||||
await an.cancel()
|
await nursery.cancel()
|
||||||
else:
|
else:
|
||||||
raise mechanism
|
raise mechanism
|
||||||
|
|
||||||
|
|
@ -289,8 +289,8 @@ async def test_cancel_infinite_streamer(
|
||||||
trio.fail_after(4),
|
trio.fail_after(4),
|
||||||
trio.move_on_after(1) as cancel_scope
|
trio.move_on_after(1) as cancel_scope
|
||||||
):
|
):
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'donny',
|
'donny',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -303,7 +303,7 @@ async def test_cancel_infinite_streamer(
|
||||||
|
|
||||||
# we support trio's cancellation system
|
# we support trio's cancellation system
|
||||||
assert cancel_scope.cancelled_caught
|
assert cancel_scope.cancelled_caught
|
||||||
assert an.cancel_called
|
assert n.cancel_called
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
@ -698,7 +698,7 @@ async def test_nested_multierrors(
|
||||||
async with fail_after_w_trace(timeout):
|
async with fail_after_w_trace(timeout):
|
||||||
try:
|
try:
|
||||||
async with (
|
async with (
|
||||||
tractor.open_nursery() as an,
|
tractor.open_nursery() as nursery,
|
||||||
trio.open_nursery() as tn,
|
trio.open_nursery() as tn,
|
||||||
):
|
):
|
||||||
for i in range(subactor_breadth):
|
for i in range(subactor_breadth):
|
||||||
|
|
@ -706,7 +706,7 @@ async def test_nested_multierrors(
|
||||||
partial(
|
partial(
|
||||||
tractor.to_actor.run,
|
tractor.to_actor.run,
|
||||||
spawn_and_error,
|
spawn_and_error,
|
||||||
an=an,
|
an=nursery,
|
||||||
name=f'spawner_{i}',
|
name=f'spawner_{i}',
|
||||||
breadth=subactor_breadth,
|
breadth=subactor_breadth,
|
||||||
depth=depth,
|
depth=depth,
|
||||||
|
|
@ -792,8 +792,8 @@ def test_cancel_via_SIGINT(
|
||||||
with trio.fail_after(2):
|
with trio.fail_after(2):
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
) as an:
|
) as tn:
|
||||||
await an.start_actor('sucka')
|
await tn.start_actor('sucka')
|
||||||
if 'mp' in start_method:
|
if 'mp' in start_method:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
os.kill(pid, signal.SIGINT)
|
os.kill(pid, signal.SIGINT)
|
||||||
|
|
@ -1054,8 +1054,8 @@ def test_fast_graceful_cancel_when_spawn_task_in_soft_proc_wait_for_daemon(
|
||||||
start = time.time()
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
async with trio.open_nursery() as nurse:
|
async with trio.open_nursery() as nurse:
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as tn:
|
||||||
p = await an.start_actor(
|
p = await tn.start_actor(
|
||||||
'fast_boi',
|
'fast_boi',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,8 @@ def test_actor_managed_trio_nursery_task_error_cancels_aio(
|
||||||
async def main():
|
async def main():
|
||||||
|
|
||||||
# cancel the nursery shortly after boot
|
# cancel the nursery shortly after boot
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
p = await an.start_actor(
|
p = await n.start_actor(
|
||||||
'nursery_mngr',
|
'nursery_mngr',
|
||||||
infect_asyncio=asyncio_mode, # TODO, is this enabling debug mode?
|
infect_asyncio=asyncio_mode, # TODO, is this enabling debug mode?
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
|
|
|
||||||
|
|
@ -163,12 +163,12 @@ def test_do_not_swallow_error_before_started_by_remote_contextcancelled(
|
||||||
async def main():
|
async def main():
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
debug_mode=debug_mode,
|
debug_mode=debug_mode,
|
||||||
) as an:
|
) as n:
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'errorer',
|
'errorer',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
await an.start_actor(
|
await n.start_actor(
|
||||||
'sleeper',
|
'sleeper',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,9 @@ async def test_required_args(callwith_expecterror):
|
||||||
with pytest.raises(err):
|
with pytest.raises(err):
|
||||||
await func(**kwargs)
|
await func(**kwargs)
|
||||||
else:
|
else:
|
||||||
async with tractor.open_nursery() as an:
|
async with tractor.open_nursery() as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
name='pubber',
|
name='pubber',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -180,7 +180,7 @@ def test_multi_actor_subs_arbiter_pub(
|
||||||
tractor.open_nursery(
|
tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
) as an,
|
) as n,
|
||||||
trio.open_nursery() as tn,
|
trio.open_nursery() as tn,
|
||||||
):
|
):
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ def test_multi_actor_subs_arbiter_pub(
|
||||||
|
|
||||||
if pub_actor == 'streamer':
|
if pub_actor == 'streamer':
|
||||||
# start the publisher as a daemon
|
# start the publisher as a daemon
|
||||||
master_portal = await an.start_actor(
|
master_portal = await n.start_actor(
|
||||||
'streamer',
|
'streamer',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -215,11 +215,11 @@ def test_multi_actor_subs_arbiter_pub(
|
||||||
):
|
):
|
||||||
pass # expected once we `cancel_actor()` below
|
pass # expected once we `cancel_actor()` below
|
||||||
|
|
||||||
even_portal = await an.start_actor(
|
even_portal = await n.start_actor(
|
||||||
'evens',
|
'evens',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
odd_portal = await an.start_actor(
|
odd_portal = await n.start_actor(
|
||||||
'odds',
|
'odds',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
@ -294,9 +294,9 @@ def test_single_subactor_pub_multitask_subs(
|
||||||
async with tractor.open_nursery(
|
async with tractor.open_nursery(
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
) as an:
|
) as n:
|
||||||
|
|
||||||
portal = await an.start_actor(
|
portal = await n.start_actor(
|
||||||
'streamer',
|
'streamer',
|
||||||
enable_modules=[__name__],
|
enable_modules=[__name__],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -107,13 +107,13 @@ def test_rpc_errors(
|
||||||
# do that if actually debugging subactor but keep it
|
# do that if actually debugging subactor but keep it
|
||||||
# disabled for the test.
|
# disabled for the test.
|
||||||
# debug_mode=True,
|
# debug_mode=True,
|
||||||
) as an:
|
) as n:
|
||||||
|
|
||||||
actor = tractor.current_actor()
|
actor = tractor.current_actor()
|
||||||
assert actor.is_registrar
|
assert actor.is_registrar
|
||||||
await tractor.to_actor.run(
|
await tractor.to_actor.run(
|
||||||
sleep_back_actor,
|
sleep_back_actor,
|
||||||
an=an,
|
an=n,
|
||||||
actor_name=subactor_requests_to,
|
actor_name=subactor_requests_to,
|
||||||
|
|
||||||
name='subactor',
|
name='subactor',
|
||||||
|
|
|
||||||
|
|
@ -202,10 +202,10 @@ def test_loglevel_propagated_to_subactor(
|
||||||
start_method=start_method,
|
start_method=start_method,
|
||||||
registry_addrs=[reg_addr],
|
registry_addrs=[reg_addr],
|
||||||
|
|
||||||
) as an:
|
) as tn:
|
||||||
await tractor.to_actor.run(
|
await tractor.to_actor.run(
|
||||||
check_loglevel,
|
check_loglevel,
|
||||||
an=an,
|
an=tn,
|
||||||
loglevel=level,
|
loglevel=level,
|
||||||
level=level,
|
level=level,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue