Day 2: Error Handling and Resilience

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.

A Caching Actor

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 ...

Get Seven Concurrency Models in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.