异步黑盒编程
我目前正在编写一个黑盒交易机器人,并且正在设计数据传递的方式。我意识到我想要一种异步的架构。所以我一直在实现ActionListeners和ActionPerformers,但是一些监听器在获取数据时需要进行计算,这可能需要一段时间,所以我想知道是否有一个高效的框架可以让我在最真实的情况下轻松有效地进行异步编程时间方式可能。
我基本上有两个问题: 在整个程序中进行异步套接字和通信的最佳方法 编写实时应用程序的最佳编程语言或框架
I am currently writing a black box trading bot and I am in the process of designing the way data is passed around. I realize I want an async sort of architecture. So I have been implementing ActionListeners and ActionPerformers but some of the listeners when they get data need to do calculation which could take a while, so I am wondering if there is an efficient framework that allows me to program async easily and effectively in the most real time way possible.
I basically have two questions:
Best way to do async sockets and communication throughout a program
Best programming language or framework to write realtime applications
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会使用多线程而不是多路复用 I/O。 Java对多线程的支持非常强大。阅读 Brian Goetz 的书《Java 并发实践》。
I would use multiple threads rather than multiplexed I/O. Java has very strong support for multithreading. Read Brian Goetz's book "Java Concurrency in Practice".
尝试 Scala。它有一个非常好的参与者模型,使并发编程几乎变得轻松。您可以在此处了解 Scala 的 Actor
Try Scala. It has a very nice actor model which makes concurrent programming almost painless. You can read about Scala's actors here
Actor 框架使降神会像@Vilius 所说的那样。有 Scala 和 Akka、Groovy 和 GPars、C/C++ 和 Theron 等。
请参阅:http://en .wikipedia.org/wiki/Actor_model 了解更多信息。
此外,该领域还有一个名为 CEP Trader (http://code.google.com/p/cep-trader/) 的开源项目,也许您可以自愿参与。
The actor framework makes seance like @Vilius said. There is Scala with Akka, Groovy with GPars, C/C++ with Theron, etc.
See: http://en.wikipedia.org/wiki/Actor_model for more information.
Also there is a open source project on this areas called CEP Trader (http://code.google.com/p/cep-trader/) which perhaps you can volunteer.