tags:

views:

149

answers:

3

Does any body knows a Java equivalent of node.js?

Thanks!

+5  A: 

The closest will be IO-Frameworks like: Netty, Apache Mina or friends.
But there's no such simple Framework in the Java World while Java has multithreading and therefore every framework will use it for better scalibility.

Tobias P.
A: 

Are you talking about running javascript on the JVM? Rhino is an option. If you're looking for evented Java, then try Kilim and Jetlang.

Sudhir Jonathan
I am not sure but I think he means evented io for Java.
nalply
Then Kilim(http://www.malhar.net/sriram/kilim/) and Jetlang (http://code.google.com/p/jetlang/) I guess.
Sudhir Jonathan
+1  A: 

I think the most important thing about node.js is that (almost) everything is non-blocking. As soon as you start to call blocking code, the whole application falls apart (in terms of performance).

Although there is async i/o for Java (i.e. java.nio), it is quite hard to force this steadily asynchronity in all parts of a Java program. So most users would tend to re-use existing libraries, which almost all block and thus circumvent the power of complete asynchronity. So it might be feasable by hiding all blocking call in an abstraction layer, but most users would fail using it at all.

Also the language itself is less appropriate for intensive callback chaining, due to missing first-member methods and closures (yet).

PartlyCloudy