Design and introduction to epoll
Okay, so this chapter will be centered around one main example you can find in the repository under ch04/a-epoll
. We’ll start by taking a look at how we design our example.
As I mentioned at the start of this chapter, we’ll take our inspiration from mio
. This has one big upside and one downside. The upside is that we get a gentle introduction to how mio
is designed, making it much easier to dive into that code base if you want to learn more than what we cover in this example. The downside is that we introduce an overly thick abstraction layer over epoll, including some design decisions that are very specific to mio
.
I think the upsides outweigh the downsides for the simple reason that if you ever want to implement a production-quality event loop, you’ll probably want to look into the implementations that are already out there, and the same goes for if you want to dig deeper into the building blocks of asynchronous programming...