I know this is quite an open ended question and I apologize.
I can see that Await.ready
returns Awaitable.type
while Await.result
In general, both are blocking.
The difference is that Await.ready
is blocking until the Future has finished (successful or failed) in given time.
The only one difference is that ready
blocks until the Awaitable
is ready and the result
does yield the result type T
.
Postscriptum:
In practice, if you want to perform some actions like error checking or logging you would take Await.ready(...)
if you want to compose the result and throw an error if something goes wrong take Await.result(...)
.
As rule of thumb - try to avoid Await.