简体   繁体   English

扭曲在 Java

[英]Twisted in Java

What is the closest Java alternative to Twisted ?最接近Twisted的 Java 替代品是什么?

Nio is really low level and supports Socket only and SSL if you dig hard enough on Google for samples. Nio 的级别非常低,并且仅支持 Socket 和 SSL,如果您在 Google 上足够努力地挖掘样本的话。

Apache Mina wraps the complexity and adds a few protocols but not as much as Twister. Apache Mina 封装了复杂性并添加了一些协议,但没有 Twister 那么多。

Like Stephane, I would suggest you take a look at Mina .和 Stephane 一样,我建议你看看Mina Its a framework for asynchronous network IO.它是一个异步网络框架IO。 It is built on top of NIO, which was mentioned earlier, and IMO hides away some of the complexity involved with Selectors,Channels,etc.. I've used Mina for a couple of projects and its pretty good, but be warned, I've found the documentation to be a little weak.它建立在前面提到的 NIO 之上,IMO 隐藏了与选择器、通道等相关的一些复杂性。我在几个项目中使用过 Mina,它非常好,但请注意,我发现文档有点弱。 And again, like Stephane mentioned, it doesn't have out of the box support for too many protocols.再一次,就像 Stephane 提到的那样,它没有对太多协议的开箱即用支持。

I've implemented most of a Twisted reactor in my collection of AMP hacks on launchpad - but it needs a maintainer.我已经在启动板上的 AMP hacks 集合中实现了大部分 Twisted reactor - 但它需要维护者。

If there is still an interest in this, I've just put up the first beta release of the 'Reaction' framework, which supports the Twisted-style deferred callback model in Java.如果对此仍有兴趣,我刚刚发布了“Reaction”框架的第一个 beta 版本,它支持 Java 中的 Twisted 式延迟回调 model。 As well as working as a standard Java package, it can also be used as an OSGi service.除了作为标准 Java package 工作外,它还可以用作 OSGi 服务。 License is Apache version 2.许可证是 Apache 版本 2。

More details on my website, >here< .我的网站上的更多详细信息, >这里<

I don't think there is anything quite like Twisted, as far as Deferreds and complex callback chains go.就延迟和复杂的回调链 go 而言,我认为没有任何东西像 Twisted 那样。 For non-blocking IO, I think NIO is the most commonly-used solution.对于非阻塞IO,我认为NIO是最常用的方案。 In particular, look at this section on Selectors.特别是,请查看有关选择器的这一部分

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

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