Use `.wait_for_result()` in dated examples

Swap the deprecated `portal.result()` calls for the modern
`.wait_for_result()` spelling in,
- `a_trynamic_first_scene.py` (x2)
- `actor_spawning_and_causality.py`
- `parallelism/single_func.py`

These 3 are literalinclude'd by the new docs tree so the rendered
code must teach the current api; the `debugging/` set still calls
`.result()` (pexpect pattern-matched tests, left for a follow-up
sweep).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Gud Boi 2026-06-11 15:14:32 -04:00
parent 6a1149d401
commit 9c1eb04eb5
3 changed files with 4 additions and 4 deletions

View File

@ -35,8 +35,8 @@ async def main():
name='gretchen', name='gretchen',
other_actor='donny', other_actor='donny',
) )
print(await gretchen.result()) print(await gretchen.wait_for_result())
print(await donny.result()) print(await donny.wait_for_result())
print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...") print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...")

View File

@ -20,7 +20,7 @@ async def main():
# The ``async with`` will unblock here since the 'some_linguist' # The ``async with`` will unblock here since the 'some_linguist'
# actor has completed its main task ``cellar_door``. # actor has completed its main task ``cellar_door``.
print(await portal.result()) print(await portal.wait_for_result())
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -33,7 +33,7 @@ async def main():
await burn_cpu() await burn_cpu()
# wait on result from target function # wait on result from target function
pid = await portal.result() pid = await portal.wait_for_result()
# end of nursery block # end of nursery block
print(f"Collected subproc {pid}") print(f"Collected subproc {pid}")