Wednesday, January 4, 2017

Promise in java


Asynchronous programming becomes popular in java world. But if you come from Javascript world, you wonder whether java has such as facility like Promise. Yes, it does. Moreover, it is more powerful than Promise. Why? Java is a multi-threaded programming language. A promise can be executed in another thread concurrently or by a thread pool.  On the other hand, javascript is single-threaded language. All promises are executed in the main event thread.
Here is Java Promise API comparison with javascript Promise API.






No comments:

Post a Comment