Which Actor model library/framework for python and Erlang-like?
Solution 1
To make actors with gevent, use a Greenlet subclass with embedded gevent.queue.Queue instance used as an inbox. To read a message from the inbox, simply get() from the queue. To send a message to an actor, put it into that actor's queue.
Read about subclassing Greenlet here.
If you need help with writing the Actor class, feel free to ask the mailing list.
Solution 2
Check out pulsar, it is a concurrent framework for python which uses the actor model as source of parallel execution.
Solution 3
I know this question is a bit dated but here is another actor resource for python now:
https://github.com/godaddy/Thespian
Documentation can be found here:
http://godaddy.github.io/Thespian/doc/
EDIT:
The primary author of this library has since left GoDaddy and forked the repo:
https://github.com/kquick/Thespian
New docs can be found here:
Solution 4
PARLEY and Pykka are listed on this Wikipedia Actor Model page so you might want to look into one of those.
Pykka seems to be actively developed (1.0.1 released in Dec 2012) whereas PARLEY hasn't had a release since 2007 (and is still listed as beta) . Pykka claims to be insipired by Akka only in name is not a simply a python port.
Solution 5
I would take a look at this: https://bitbucket.org/fzzzy/python-actors
It's pretty much a straight clone of the Erlang actor model, with "saved" messages queue, links and everything.
Related videos on Youtube
daitangio
A Solution Architect, mostly active on Java/.NET/BigData SOreadytohelp
Updated on September 07, 2020Comments
-
daitangio over 3 years
I am looking for an easy-to-learn Actor library or framework for Python 2.x. I have tried Candygram and Twisted but I did not like them. I'd like something that will be easy to extend to suppero Greenlet (= stackless python).
- Candygram is too old.
- Twisted is too complicated.
- Gevent: it is unclear if it can support Actors model.
What do you suggest?
-
Daniel Yankowsky over 13 yearsI don't know anything about Candygram, but I thought Twisted was more oriented around networking than around Actor-based concurrency.
-
Shruti Singh over 13 yearsThe best Erlang like actors are implemented in Erlang. Do concurrent oriented work in Erlang and left rest of work to python through ports. I would do whole work in Erlang but if someone think that Python is better for any task it is his taste.
-
user1496984 over 9 yearsPulsar seems to be maintained very well, and also supports Python3's
asyncio
functionalities.