6

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?

JoelPM
  • 1,752
  • 2
  • 11
  • 7

4 Answers4

6

I am a bit late but:

Have you looked at Netty? Or Grizzly.

Elazar Leibovich
  • 32,750
  • 33
  • 122
  • 169
fedesilva
  • 1,532
  • 13
  • 12
1

How about the Light Weight Event System? :) http://www.lwes.org/ and http://sourceforge.net/projects/lwes/files/

Chris Dennett
  • 22,412
  • 8
  • 58
  • 84
  • LWES actually meets a different need - and I happen to work with some of the guys who wrote it :) Thanks for the recommendation, though. – JoelPM Feb 26 '10 at 06:11
1

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/

JoelPM
  • 1,752
  • 2
  • 11
  • 7
-1

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

saugata
  • 2,823
  • 1
  • 27
  • 39
  • I don't think OP was interested in BPM or workflow management solutions. libevent is about non-blocking network io – Tair Mar 24 '12 at 08:54