2021-02-24 18:39:14 +00:00
|
|
|
import trio
|
2020-10-04 13:54:36 +00:00
|
|
|
import tractor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def name_error():
|
2024-05-28 13:22:59 +00:00
|
|
|
getattr(doggypants) # noqa (on purpose)
|
2020-10-04 13:54:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
async def main():
|
2021-02-24 18:39:14 +00:00
|
|
|
async with tractor.open_nursery(
|
|
|
|
|
debug_mode=True,
|
2024-05-28 13:22:59 +00:00
|
|
|
) as an:
|
2020-10-04 13:54:36 +00:00
|
|
|
|
2024-05-28 13:22:59 +00:00
|
|
|
# TODO: ideally the REPL arrives at this frame in the parent,
|
2026-07-06 16:24:29 +00:00
|
|
|
# ABOVE the @api_frame of `to_actor.run()` ..
|
2024-05-28 13:22:59 +00:00
|
|
|
# await tractor.pause()
|
|
|
|
|
|
2026-07-06 16:24:29 +00:00
|
|
|
# the one-shot blocks on the subactor's result so the
|
|
|
|
|
# boxed `NameError` raises right here.
|
|
|
|
|
await tractor.to_actor.run(name_error, an=an)
|
2020-10-04 13:54:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2021-02-24 18:39:14 +00:00
|
|
|
trio.run(main)
|