Forums Register Login
Node.JS like Functionality in Java
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,

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.

Let me know if the question is obscure or require more info.
If it is not the suitable forum, Can this be moved to somewhere else ?

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.

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.
The moustache of a titan! The ad of a flea:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 979 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 22, 2019 19:51:07.