Java Magazine, Jan/Feb 2018
ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2018 34 reactive programming most APIs have been designed to follow this approach However computer systems and distribution systems are asynchronous Synchronous processing is a simplification made to provide ease of comprehension For years the asynchronous nature Implementing reactive systems requires two shifts an execution shift to use an asynchronous execution model and a development shift to write asynchronous APIs and applications of systems has been ignored and now its time to catch up Many modern applications are relying on I O operations such as remote invocations or access to the file system Because of the synchronous nature of application code however these I O operations are designed to be blocking so the application waits for a response before it can continue its execution To enable concurrency the application relies on multithreading and increases the number of threads But threads are expensive First the code has to protect itself from concurrent access to its state Second threads are expensive in terms of memory and often overlooked in CPU time because switching between threads requires CPU cycles Therefore a more efficient model is needed The asynchronous execution model promotes a task based concurrency in which a task releases the thread when it cannot make progress anymore for instance it invokes a remote service using nonblocking I O and will be notified when the result is available Thus the same thread can switch to another task As a result a single thread can handle several interleaved tasks Traditional development and execution paradigms are not able to exploit this new model However in a world of cloud and containers where applications are massively distributed and interconnected and they must handle continuously growing traffic the promise made by reactive systems is a perfect match But implementing reactive systems requires two shifts an execution shift to use an asynchronous execution model and a development shift to write asynchronous APIs and applications This is what Eclipse Vert x ofers In the rest of this article we present how Vert x combines both to give you superpowers
You must have JavaScript enabled to view digital editions.