17

Implementing Actors and Async with the Hyper Framework

The actor model has shown us that we can build async code that is safe and easy to maintain. In this chapter, we take the actor model a little further by building a caching mechanism with a background task that keeps running while we accept incoming HTTP requests using the Hyper framework. It must be noted that a Hyper framework is a low-level approach to processing HTTP requests. This enables us to build web applications where we have fine grain control over how the HTTP server handles HTTP requests. For instance, if we do not code how to handle Universal Resource Identifiers (URIs) and methods, the HTTP server built in Hyper will handle all requests, in the same way, no matter the method ...

Get Rust Web Programming - Second Edition 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.