Chapter 9
- Blocking computations block the thread they are using in case they need to wait for some event to happen. Non-blocking computations release the thread if they don't need it. Released threads can be reused by other tasks.
- You need asynchronous programming so that the threads are utilized doing useful work and not waiting upon an event to happen.
- You can separate the business logic from the strategy of concurrent execution.
-
IO
is an effect type which encapsulates the side effect of delayed computations. It uses the computation-as-a-value approach, and thus is a specification of the computation to be performed. start
to startIO
asynchronously from a monadic flow.flatMap
to composeIO
with otherIO
s sequentially. Please see API documentation ofIO
for the full list.