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.