I am using play framework , i read that Play handles every request in non blocking way. So what is the difference between Blocking & Non Blocking Future in Scala?
Also please provide information about Future & Await.Result() method Thanks !!!
If Await.Result()
is called at any point before the Future
has completed, the Future
becomes blocking. If you instead use onComplete
, onSuccess
, onFailure
, map
, or flatMap
(and some other methods), you are registering a callback function that will occur when the Future
returns. Thus, the Future
is non-blocking. Use non-blocking Future
s with callbacks whenever possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With