forked from goodboy/tractor
1
0
Fork 0
Commit Graph

11 Commits (fc46f5b74a2874f06f98718bf92e601b962717ce)

Author SHA1 Message Date
Tyler Goodlet fc46f5b74a Proxy asyncio cancelleds as well 2021-10-06 17:05:58 -04:00
Tyler Goodlet de87cb510a WIP redo asyncio async gen streaming 2021-10-06 17:05:58 -04:00
Tyler Goodlet a237dcd020 Pass func refs 2021-10-06 17:05:58 -04:00
Tyler Goodlet 9a994e2de3 Raise any asyncio errors if in trio task on cancel 2021-10-06 17:05:58 -04:00
Tyler Goodlet d2a810d950 Raise from asyncio error; fixes mypy 2021-10-06 17:05:58 -04:00
Tyler Goodlet 07c2151010 Tweak log msg 2021-10-06 17:05:58 -04:00
Tyler Goodlet 0d825ae6d7 Log error 2021-10-06 17:05:58 -04:00
Tyler Goodlet 3c1cc90c40 Attempt to make mypy happy.. 2021-10-06 17:05:58 -04:00
Tyler Goodlet 558ba7e008 Wow, fix all the broken async func invoking code..
Clearly this wasn't developed against a task that spawned just an async
func in `asyncio`.. Fix all that and remove a bunch of unnecessary func
layers. Add provisional support for the target receiving the `to_trio`
and `from_trio` channels and for the @tractor.stream marker.
2021-10-06 17:05:58 -04:00
Tyler Goodlet 96cf4a962d Move asyncio guest mode entrypoint to `to_asyncio`
The function is useful if you want to run the "main process" under
`asyncio`. Until `trio` core wraps this better we'll keep our own copy
in the interim (there's a new "inside-out-guest" mode almost on
mainline so hang tight).
2021-10-06 17:05:58 -04:00
Tyler Goodlet fd70965422 Propagate any spawned `asyncio` task error upwards
This should mostly maintain top level SC principles for any task spawned
using `tractor.to_asyncio.run()`. When the `asyncio` task completes make
sure to cancel the pertaining `trio` cancel scope and raise any error
that may have resulted.

Resolves #120
2021-10-06 17:05:58 -04:00