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

Counting the responded actors

In the example, we counted the child actors that responded to an actor in order to determine when an actor is ready to respond to its parent actor:

answered += 1// ...if (answered == children.size) {  to ! Result(buffer)  context stop self}

This scenario can give rise to certain undesirable outcomes. First of all, it means the time that it takes for the system to respond is equal to the time it takes for the deepest and slowest link to be resolved and processed.

The logic behind this reasoning is as follows. The processing callback determines when a node of a processing tree is considered completed:

if (answered == children.size)

So a node is completed whenever its slowest child is completed. However, we should ...

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