This was once a port of Jon Brisbin's Misultin Riak Core VNode dispatcher example to Cowboy.
The example is 6 years old and therefore is terribly out of date. And it was not a great efficiency example to begin with. The author would recommend against using it.