rust-memcache icon indicating copy to clipboard operation
rust-memcache copied to clipboard

Support connection pooling within Client

Open letmutx opened this issue 4 years ago • 2 comments

After #97 lands, it'll be nice to have connection pools to prevent threads from connection starvation. Client should support connection pooling behind a feature flag.

Right now, we have r2d2-memcache for this, but it creates Client instances instead of Connection objects which is inefficient if Client contains multiple Connections.

letmutx avatar Jan 26 '20 16:01 letmutx

I am collaborator of r2d2-memcache, feel free if you willing to modify it.

And for other feature requests, I just have one suggest is that we can learn from https://github.com/mitsuhiko/redis-rs , I think it have more users and have better experimented maitainers.

For now redis-rs have no pooling in client, but seems they had a plan: https://github.com/mitsuhiko/redis-rs/tree/92dcf0820bff731ec48543e8e11854cbf2c55504#basic-operation . So I think we can support this feature. What do you think? @lemutx

aisk avatar Jan 29 '20 12:01 aisk

I think it's better to export single connection management for users, connection pool customization is required. For current implementation using r2d2 is too limited and cannot even use r2d2's full functionality.

leptonyu avatar Apr 09 '21 10:04 leptonyu