Closed uschi2000 closed 2 years ago
My instinct would be to have something like a map of r2d2 pools keyed off of bucket_a
/bucket_b
, etc. You'll probably want to have them share a thread pool, but once you do that it should behave pretty reasonably I think: https://docs.rs/r2d2/0.8.9/r2d2/struct.Builder.html#method.thread_pool
Cool, yeah that's what I meant by A map/cache of r2d2 pools
above. We'll play around with that. I assume you have no interest in supporting a notion of "named pools" in r2d2 APIs, right?
Yeah, I think for now it'd make sense to keep it separate.
Imagine a scenario where you have clients for a (small) number of different S3 buckets (alternatively, Azure blob containers, etc). Each bucket requires different credentials. I would write configuration like:
Then I'd love to say something like:
In other words a pool of "named" connections. Is this something you've been thinking about, @sfackler ? If not, do you have a suggestions for a cheap workaround/hack on top of r2d2? A map/cache of r2d2 pools?