Switch from deadpool-redis
to a home-grown alternative
#482
Labels
enhancement
New feature or request
deadpool-redis
to a home-grown alternative
#482
The next version of
redis-rs
will deprecateaio::Connection
in favour of its multiplexed counterpart.With that deprecation there is no benefit of using a traditional pooling system like
deadpool
since these systems are built on the premise of quickly "borrowing" something from a pool and then returning the object.These borrows are exclusive since they give you temporary ownership, which isn't utilizing a multiplex-ready connection optimally.
Solution
A new custom solution which internally looks something like this:
Something like that. This will use a strategy to choose an object from a slice of objects which is then subsequently cloned.
An example strategy could be a round-robin strategy using an atomic integer to increment modulo the pool length so you don't have to reset the counter ever.
That way you can ensure an optimal utilization of all connections since in a highly contented scenario, connections can serve N in-flight requests at the same time.
The text was updated successfully, but these errors were encountered: