pythonerlangactorpython-stackless

Which Actor model library/framework for python and Erlang-like?


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).

What do you suggest?


Solution

  • 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.