哪个Actor模型库/框架为python和Erlang样? [英] Which Actor model library/framework for python and Erlang-like?

查看:236
本文介绍了哪个Actor模型库/框架为python和Erlang样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个易于学习的Actor库或Python 2.x的框架。我试过Candygram和Twisted,但我不喜欢他们。我想要一些很容易扩展到绿宝石(= stackless python)的东西。




  • 糖果图太旧了。 >
  • Twisted太复杂了。

  • Gevent:它是否可以支持Actors模型是不清楚的。



你建议什么?

解决方案

使演员使用 gevent ,使用 Greenlet 子类,嵌入式 gevent.queue.Queue 实例用作收件箱。要从收件箱读取邮件,只需 get()从队列。要向演员发送消息,请将其放入该演员的队列。



阅读在这里分类Greenlet



如果您需要帮助编写Actor类,请随时使用询问邮件列表


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?

解决方案

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.

这篇关于哪个Actor模型库/框架为python和Erlang样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆