As we saw in Resilient Software for an Unpredictable World, one of the key benefits of concurrency is that it enables us to write fault-tolerant code. Today we’ll look at the tools that actors provide that enable us to do so.
First, though, let’s use the lessons from yesterday to create a slightly more complicated and realistic example, which we’ll use as the basis for today’s discussion.
We’re going to create a simple cache for webpages. A client can add a page to the cache by providing a URL together with the text of the page, query the cache for the page associated with a URL, and query the cache to see how many bytes it contains.
We’re going to use a dictionary to store the mapping ...