To avoid the cost of establishing a new connection to a MySQL DB
on potentially every page request, I tried making one connection to
the DB upon startup of my vibe.d app and then use that one connection
for each request. Worked fine until I tried making concurrent page
requests, at which point I (perhaps unsurprisingly) got a message about
the wrong fiber accessing a connection and then it died with an
InvalidMemoryOperationError. (But annoyingly, I can't seem to reproduce
it now.)
So I realize that's probably not a smart thing to do anyway, to share a
single connection across fibers. But how would I go about reusing DB
connections when possible? By using ConnectionPool, maybe? But I'm not
quite sure how to use that.