Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Node.JS like Functionality in Java

 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the good thing about the Node.JS is, it never idles ( in a single thread too).
For ex: If you're fetching a Url content, Node.JS actually doesn't block on it. It goes on with other execution.
And once the content is fetched, your callback will be invoked.
The good thing is,There is no explicit context switching from the OS as it runs within the VM ( V8 engine).


Is there away to achieve this kind of functionality in Java.
The whole purpose is not to use thread, which causes context switching and synchronization cost.
I've following use case, which I think can benefit from this,

Ex:
There is a Java service ( more like a Facade) and which internally calls other independent remote services and accumulates the data.
It is actually blocks on the response of each service, so the total response is cumulative rather than the highest blocking response of a service.



 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me know if the question is obscure or require more info.
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is not the suitable forum, Can this be moved to somewhere else ?
 
Winston Gutkowski
Bartender
Pie
Posts: 10254
59
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pratap koritala wrote:If it is not the suitable forum, Can this be moved to somewhere else ?

Can you suggest where? Node.js is based on JavaScript, which is NOT Java, despite the similarity in name.

It's possible that somebody is trying to re-invent this wheel in pure Java, but I don't honestly know what the best of our forums would be. If you'd like to suggest one, I'll be happy to move it for you.

Winston
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not much familiar with node.js, but I do know that one of my ex-colleague is leading the vertx.io project, which I think is similar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic