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

daitangio picture daitangio · Aug 6, 2010 · Viewed 23.2k times · Source

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?

Answer

Denis Bilenko picture Denis Bilenko · Aug 8, 2010

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.