Tyler Goodlet
b7d5ff79b4
Always cancel the asyncio task?
2021-10-27 16:06:44 -04:00
Tyler Goodlet
60b892cc80
WIP, add back in root shield, print out pdb sigint opts
2021-10-27 16:06:44 -04:00
Tyler Goodlet
cbc18f94ec
Drop old implementation cruft
2021-10-27 16:06:44 -04:00
Tyler Goodlet
e016884ce0
Fix error propagation on asyncio streaming tasks
2021-10-27 16:06:44 -04:00
Tyler Goodlet
d42f628597
Drop bad .close() call
2021-10-27 16:06:44 -04:00
Tyler Goodlet
a572fde6c6
Proxy asyncio cancelleds as well
2021-10-27 16:06:44 -04:00
Tyler Goodlet
8805cbee3d
Don't kill root's immediate children when in debug
...
If the root calls `trio.Process.kill()` on immediate child proc teardown
when the child is using pdb, we can get stdstreams clobbering that
results in a pdb++ repl where the user can't see what's been typed. Not
killing such children on cancellation / error seems to resolve this
issue whilst still giving reliable termination. For now, code that
special path until a time it becomes a problem for ensuring zombie
reaps.
2021-10-27 16:06:44 -04:00
Tyler Goodlet
004722914b
WIP redo asyncio async gen streaming
2021-10-27 16:06:44 -04:00
Tyler Goodlet
1e2d43b0d6
Support asyncio actors with the trio spawner backend
2021-10-27 16:06:44 -04:00
Tyler Goodlet
948be9b069
Support sync code breakpointing via built-in
...
Override `breakpoint()` for sync code making it work
properly with `trio` as per:
https://github.com/python-trio/trio/issues/1155#issuecomment-742964018
Relates to #193
2021-10-27 16:06:44 -04:00
Tyler Goodlet
2fbc4caacb
Support asyncio actors with the trio spawner backend
2021-10-27 16:06:44 -04:00
Tyler Goodlet
2ea020310d
Link to SC on wikipedia
2021-10-27 16:06:44 -04:00
Tyler Goodlet
2c52530ef0
Add per actor debug mode toggle
2021-10-27 16:06:44 -04:00
Tyler Goodlet
ae682c0f19
Support sync code breakpointing via built-in
...
Override `breakpoint()` for sync code making it work
properly with `trio` as per:
https://github.com/python-trio/trio/issues/1155#issuecomment-742964018
Relates to #193
2021-10-27 16:06:44 -04:00
Tyler Goodlet
cabc41fcfa
Pass func refs
2021-10-27 16:06:44 -04:00
Tyler Goodlet
7b149dd3e4
Add initial infected asyncio error propagation test
2021-10-27 16:06:44 -04:00
Tyler Goodlet
2cf98d5e09
Raise any asyncio errors if in trio task on cancel
2021-10-27 16:06:44 -04:00
Tyler Goodlet
81cd21c04b
Raise from asyncio error; fixes mypy
2021-10-27 16:06:44 -04:00
Tyler Goodlet
bba03654ea
Tweak log msg
2021-10-27 16:06:44 -04:00
Tyler Goodlet
d337a54fb6
Log error
2021-10-27 16:06:44 -04:00
Tyler Goodlet
ac5b3628d2
Support asyncio actors with the trio spawner backend
2021-10-27 16:06:44 -04:00
Tyler Goodlet
a6b6241176
Revert removal of `infect_asyncio` in nursery start methods
2021-10-27 16:06:44 -04:00
Tyler Goodlet
e54ddac5b9
Attempt to make mypy happy..
2021-10-27 16:06:44 -04:00
Tyler Goodlet
d17774b2b0
Add an obnoxious error message on internal failures
2021-10-27 16:06:44 -04:00
Tyler Goodlet
5c31281557
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-27 16:06:44 -04:00
Tyler Goodlet
dee6c987a9
Drop entrypoints from `Actor`
2021-10-27 16:06:44 -04:00
Tyler Goodlet
d4699b987b
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-27 16:06:44 -04:00
Tyler Goodlet
60739ce571
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-27 16:06:44 -04:00
Tyler Goodlet
417cebe827
Add a @pub kwarg to allow specifying a "startup response message"
2021-10-27 16:06:44 -04:00
Tyler Goodlet
490a046f6b
Support sync code breakpointing via built-in
...
Override `breakpoint()` for sync code making it work
properly with `trio` as per:
https://github.com/python-trio/trio/issues/1155#issuecomment-742964018
Relates to #193
2021-10-27 16:06:44 -04:00
Tyler Goodlet
8852dde810
Add `maybe_open_context()` an actor wide task-resource cache
2021-10-27 14:06:27 -04:00
goodboy
5dbe8e4b14
Merge pull request #241 from goodboy/trionics
...
Trionics
2021-10-27 13:09:11 -04:00
goodboy
9c13827a14
Merge pull request #256 from overclockworked64/241-news-fragment
...
Add a news fragment
2021-10-27 12:38:15 -04:00
overclockworked64
6da76949fd
Fix the syntax and point to the new package
2021-10-27 17:03:25 +02:00
overclockworked64
49dd230b4f
Add a newline
2021-10-25 20:01:21 +02:00
overclockworked64
c7f59bd483
Add a news fragment
2021-10-25 19:17:42 +02:00
Tyler Goodlet
083b73ad4a
Test: don't grab debug lock if not in mode
2021-10-25 10:22:41 -04:00
goodboy
925af28092
Merge pull request #254 from goodboy/graceful_gather
...
Change to `gather_contexts()`, use event for graceful exit
2021-10-25 10:14:01 -04:00
Tyler Goodlet
d0f5c7a5e2
Change to `gather_contexts()`, use event for graceful exit
...
The api we've made here is actually closer to `asyncio.gather()` but
with opening async context managers instead of funcs. Use another event
to allow for graceful teardown of children on non-cancellation exits
and add a doc string.
2021-10-24 14:00:01 -04:00
goodboy
ebf080b8a2
Merge pull request #253 from overclockworked64/fix-type-annotation
...
Fix type annotations
2021-10-23 19:09:11 -04:00
overclockworked64
50400359b8
Fix type annotations
2021-10-24 00:47:26 +02:00
goodboy
71b8f9f1ea
Merge pull request #252 from goodboy/246_facepalm_backup
...
Trionics improvements from @overclockworked64
2021-10-23 18:10:17 -04:00
overclockworked64
b91adcf38d
Get rid of external teardown trigger
2021-10-23 16:17:30 -04:00
overclockworked64
87e3d32992
Get rid of external teardown trigger because #245 resolves the problem
2021-10-23 16:17:30 -04:00
overclockworked64
04895b9d5e
Get rid of dumb random uid and use current actor's uid
2021-10-23 16:17:30 -04:00
overclockworked64
b7a4641674
Allow specifying start_method and hard_kill
2021-10-23 16:17:30 -04:00
overclockworked64
c1089dbd95
Add a clustering test
2021-10-23 16:17:30 -04:00
overclockworked64
3130a04c61
Rename a variable and fix type annotations
2021-10-23 16:17:29 -04:00
overclockworked64
6f9229cd09
Cancel nursery
2021-10-23 16:17:29 -04:00
overclockworked64
6e6baf250b
Make sure the ID is a str
2021-10-23 16:17:29 -04:00