Java 中是否有与 libevent 相当的工具?

发布于 2024-08-23 00:42:48 字数 307 浏览 6 评论 0原文

我编写了一个高吞吐量服务器,它在自己的线程中处理每个请求。对于传入的请求,有时需要对一个或多个后端执行 RPC。这些后端 RPC 由单独的队列和线程池处理,这对创建的线程数和后端的最大连接数提供了一些限制(它会进行一些缓存以重用客户端并节省开销)不断地建立联系)。不过,完成所有这些后,我开始认为基于事件的架构会更有效。

在搜索过程中,我没有找到任何与 Java 的 libevent 等效的东西,但也许我没有找对地方? Apache 的 Mina-statemachine 是我发现的最接近的东西,但它看起来比我需要的更详细,而且没有真正的可用版本。

有什么建议吗?

I've written a high-throughput server that handles each request in its own thread. For requests coming in it is occasionally necessary to do RPCs to one or more back-ends. These back-end RPCs are handled by a separate queue and thread-pool, which provides some bounding on the number of threads created and the maximum number of connections to the back-end (it does some caching to reuse clients and save the overhead of constantly creating connections). Having done all this, though, I'm beginning to think an event-based architecture would be more efficient.

In searching around I haven't found any equivalents to libevent for Java, but maybe I'm not looking in the right place? Mina-statemachine from Apache was the closest thing I found, but it looks more verbose than I need and there's no real release available.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

往事随风而去 2024-08-30 00:42:48

我有点晚了,但是:

你看过 Netty 吗?
或者Grizzly

I am a bit late but:

Have you looked at Netty?
Or Grizzly.

星光不落少年眉 2024-08-30 00:42:48

答案似乎是否定的,尽管 Ruby EventMachine 库看起来为 JRuby 用户提供了一个 Java 实现,该实现可能可用,或者至少可以为我自己的编写提供灵感:
http://github.com/eventmachine/eventmachine/tree/master/java/< /a>

The answer seems to be 'no', though it looks like the Ruby EventMachine library provides a Java implementation for JRuby users that might be usable or at least serve as inspiration for writing my own:
http://github.com/eventmachine/eventmachine/tree/master/java/

帅气尐潴 2024-08-30 00:42:48

您可能正在寻找像这样的工作流引擎
JBPM 或列出的任何其他开源工具 此处

You might be looking for a workflow engine like
JBPM or any other open source tool listed here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文