This is really nice. The sync.Pool based ring buffer is a really clever way to get around the thing that always kills my low latency work in golang.
I wonder how much the type casting costs you’ll see in real world situations? I’ve not benchmarked that generally but it’s always something I worry about with ‘generic’ data structures like this.