ebb21b9ba3
Keep an actor local (bool) flag which determines if there is already a running debugger instance for the current process. If another task tries to enter in this case, simply ignore it since allowing entry may result in a deadlock where the new task will be sync waiting on the parent stdio lock (a case that will never arrive due to the current debugger's active use of it). In the future we may want to allow FIFO queueing of local tasks where instead of ignoring re-entrant breakpoints we allow tasks to async wait for debugger release, though not sure the implications of that since you'd likely want to support switching the debugger to the new task and that could cause deadlocks where tasks are inter-dependent. It may be more sane to just error on multiple breakpoint requests within an actor. |
||
---|---|---|
.github/workflows | ||
debugging | ||
docs | ||
examples | ||
tests | ||
tractor | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
README.rst | ||
mypy.ini | ||
requirements-docs.txt | ||
requirements-test.txt | ||
setup.py |
README.rst
tractor
A structured concurrent, async-native "actor model" built on trio and multiprocessing.
tractor
is an attempt to bring trionic structured concurrency to distributed multi-core Python; it aims to be the Python multi-processing framework you always wanted.
tractor
lets you spawn trio
"actors": processes which each run a trio
scheduled task tree (also known as an async sandwich). Actors communicate by exchanging asynchronous messages and avoid sharing any state. This model allows for highly distributed software architecture which works just as well on multiple cores as it does over many hosts.
The first step to grok tractor
is to get the basics of trio
down. A great place to start is the trio docs and this blog post.
Install
No PyPi release yet!
pip install git+git://github.com/goodboy/tractor.git
Feel like saying hi?
This project is very much coupled to the ongoing development of trio
(i.e. tractor
gets all its ideas from that brilliant community). If you want to help, have suggestions or just want to say hi, please feel free to ping me on the trio gitter channel!