简体   繁体   English

是否可以同时使用Play 1.x和Akka?

[英]Is it possible to use Play 1.x and Akka together?

Has anyone tried integrating Akka with Play 1.x? 有没有人尝试将Akka与Play 1.x集成? What is your experience? 你有什么经验? I just saw that Play 1.x has had a module for Akka support for a long time: https://github.com/dwhitney/akka 我刚刚看到Play 1.x已有很长时间的Akka支持模块: https//github.com/dwhitney/akka

I guess, the question I am asking is, if I need to move to using Akka, having developed a large Play 1.x app, do I need to rewrite it to use Play 2.x to get the full benefits of Akka? 我想,我要问的问题是,如果我已经开发了大型Play 1.x应用程序而需要使用Akka,我是否需要重写它以使用Play 2.x以获得Akka的全部好处?

Didn't try that module (it's probably deprecated now with recent versions of Akka) but technically you can use Akka in Java, so you could integrate Akka actors to Play 1.x jobs by adding the right Akka dependency. 不用尝试使用该模块(最新版本的Akka现在可能已不推荐使用该模块),但是从技术上讲,您可以在Java中使用Akka,因此您可以通过添加正确的Akka依赖项将Akka actor集成到Play 1.x作业中。

This way you could have the benefits of Akka in your app (migrating from Play 1.x to Play 2.x is not straightforward). 这样,您就可以在应用程序中享受Akka的好处(从Play 1.x迁移到Play 2.x并不容易)。

Another option could be to have a dedicated Play 2.x app that handles Akka jobs on it's own and have your two apps interact with each other (ie with webservices). 另一种选择是拥有专用的Play 2.x应用程序,该应用程序自己处理Akka作业,并使您的两个应用程序彼此交互(即与Web服务交互)。 That would allow you to use Scala syntax, which I find way more practical with Akka. 那将允许您使用Scala语法,我发现Akka可以使用它更实用。

In the end it mostly depends of your architecutre, the kind of jobs you have to run and whether or not they can be split from your main app. 最后,它主要取决于您的架构,必须运行的作业类型以及是否可以从主应用程序中拆分出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM