redis / redis-rb

A Ruby client library for Redis
MIT License
3.96k stars 1.03k forks source link

Use of RedisClient built-in connection pool #1284

Closed Juanmcuello closed 2 months ago

Juanmcuello commented 2 months ago

As far as I understand, RedisClient has a built-in connection pool, so I'm wondering if it's possible to use it instead of the ConnectionPool gem suggested in the README.

byroot commented 2 months ago

redis-client uses the connection_pool gem: https://github.com/redis-rb/redis-client/blob/6d55f61cac62af91aebbd5a1d00eae7a8d940b9e/redis-client.gemspec#L31.

techiespace commented 1 month ago

@byroot Could you please help me understand this better?

I noticed that the redis gem is using the redis-client, and redis-client uses connection pooling. Does this mean that the redis gem is indirectly using connection pooling? If so, is the README out of date, and does the redis gem now support connection pooling?

I would appreciate any clarification you can provide. Thank you!

byroot commented 1 month ago

Does this mean that the redis gem is indirectly using connection pooling?

No. redis-client has a way to pool connection, but the redis-rb interface doesn't allow to use it.

It's theoretically possible to refactor redis-rb to use a pool under the hood, but it would likely break quite a lot of code, so I'm not very kin on doing it.