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
parent
d95cd94e20
commit
4313ac256c
|
|
@ -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...")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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__':
|
||||||
|
|
|
||||||
|
|
@ -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}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue