Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Delay and asynchronous computations

Imagine your program performs an HTTP call. For example, it tries to retrieve some JSON object from a web API. It can take some time; it may even take several seconds to complete.

Imagine that you want to make some competition within a function and return some value based on the result of the API request. You run into a problem here because the result of the API call was not available immediately. The fact that you need to wait for a specific long-running operation to complete is also a side effect.

You can block on this long-running operation and resume your competition once the result arrives. However, this function will also block any functions that are calling it. In the context of a performance-critical ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content