Friday, February 20, 2015

Quasar - Farewell to Asynchronous Code

Quasar is a library that adds true lightweight threads (fibers) to the JVM. These are very cheap and very fast – in fact, fibers behave just like Erlang processes or Go goroutines – and allow you to write simple blocking code while enjoying the same performance benefits of complex asynchronous code.

In this post we’ll learn how to transform any asynchronous, callback-based API, into a nice (fiber-)blocking API. It is intended for people who wish to integrate their own – or third-party – libraries with Quasar fibers. You don’t need to know this stuff if you just use Quasar fibers with channels or actors, or make use of the many integrations already available in the Comsat project (the code presented below is code the application developer never sees). But even if you don’t, you might find this post helpful in understanding how Quasar does its magic.

Read more here

Leave a Reply

All Tech News IN © 2011 & Main Blogger .