Scala Actor 模型的灵活性
我一直在使用基于参与者的编程模型和 Microsoft 的 C++ 异步代理库。 在开始尝试 Scala 后,在我看来,它的模型并不像异步代理那么丰富。例如,异步代理提供了许多不同的异步消息块,可以以不同的方式组合这些异步消息块以形成代理网络。 这如何映射到 Scala 的本地 actor,或者使用 Akka 的 actor?
I've been using actor based programming model with Microsoft's Asynchronous Agents library for C++.
Having started experimenting with Scala, it seems to me that its model is not that rich as in Asynchronous Agents. For example Async Agent provides a lot of different Asynchronous Message Blocks which can be combined in different ways to make network of agents.
How does this map to Scala's native actors, or actors using Akka?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Scala 有一种称为“案例类”的东西,可用于定义任意数量的消息类型。至于行为,这就是演员的作用。此处定义的内容 http://msdn.microsoft.com/en-us/library /dd504833.aspx 对我来说,所有这些听起来都像是行为,而且大多数都很容易用演员来实现。
Scala has something called a "case class" that can be used to define any number of message types. As for behaviors, that is what actors are for. The things defined here http://msdn.microsoft.com/en-us/library/dd504833.aspx all sound like behaviors to me, and most would be simple to implement with an actor.