Akka 主管 管理主管
我认为这里可能隐藏着一个使用 Akka 进行应用程序设计的更广泛的问题,但我会问如何建立一棵监督树,其中“内核”或“顶级”监督者可能会监督其他监督者(监督工作人员)的子级?
I reckon there might be a broader question of application design using Akka hidden in here but I'll ask how does one set up a supervision tree where a "kernel" or "top" supervisor might supervise children that are other supervisors which supervisor workers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从顶层的声明性主管开始,
其中模块 1 到 3 代表应用程序架构的下一个级别。每个模块本身都是其所有子参与者的主管,并像示例一样实现
您可以将“注册(参与者)”消息替换为更适合您的应用程序的内容,并且您可能希望跨越进一步以编程方式创建的主管层,但基本上这将是应遵循的方法。
您可以在 Scala 容错 或 容错使用 Java。
You might start with a declarative supervisor on the top level
where module 1 to 3 represents the next level of your application architecture. Each module itself is a supervisor for all of its child actors and implemented like for example
You might replace the "Register(actor)" message with something more suitable for your application, and you might want to span a further programmatically created supervisor layer but basically that would be the approach to follow.
You'll find further details (as Viktor already commented) in the official akka documentation on Fault tolerance with Scala or Fault tolerance with Java.