August 2018
Intermediate to advanced
380 pages
10h 2m
English
Previously, we briefly touched on the topic of Fibers. They are remote control units for underlying computations. We know that on any IO, we can call a start method, and that will cause it to run asynchronously, which means that it will not block the current execution flow of the IO effect type. Also, you know that we can later block on a Fiber in order to obtain the result. Notice that, here, we are blocking with respect to the Monadic flow. It is precisely the Monadic flow that is getting blocked, that is, the execution of the Monadic instructions gets suspended. The underlying thread IO used to run is not blocked by anything.
Let's see how we can implement our sum example with the help of Fibers:
def parallel: ...