mperham / connection_pool

Generic connection pooling for Ruby
MIT License
1.63k stars 143 forks source link

Make ConnectionPool::Wrapper a separate gem #78

Closed ma11hew28 closed 9 years ago

ma11hew28 commented 9 years ago
Suggestion

I like how the codebase is clean & small and the README is short & easy to understand.

But, I don't want to use ConnectionPool::Wrapper, especially because "it's not high-performance."

Let's make this gem even tighter by removing ConnectionPool::Wrapper and moving the relevant code & documentation from the README into a separate gem.

For example:

gem name: connection_pool-wrapper depends on: connection_pool gem

Thoughts?

mperham commented 9 years ago

Why do you think you have to use it?

ma11hew28 commented 9 years ago

I don't. I know it's unnecessary.

Hence, I'm suggesting that removing it would make the gem even more simple, clean, and focused.

For projects that don't need it, it's superfluity/cruft/overengineering and violates the YAGNI & KISS principles.

For projects that do use it, we could provide a separate gem, e.g., connection_pool-wrapper.

mperham commented 9 years ago

I don't think you understand Wrapper or its purpose. It's useful as a migration point from a single global connection to a full-blown connection pool. You don't have to use it, It's 25 lines of code and will stay as is.

HenleyChiu commented 9 years ago

I'm a bit confused as to what the Wrapper does.

If I use it, do I have a connection pool (albeit a low performing one)? Or is it no different than a single global connection?

mperham commented 9 years ago

You have a connection pool, low performing but does not require your code to change to use the with method.