The Crystal Programming Language Forum

Generic connection pool - merge projects?

I was looking for a generic pool for HTTP::Client connections, that are actually created for each call to my project’s endpoints.

I have first looked to https://github.com/ysbaddaden/pool. It looks good, but they are missing features like a pool size that can grow to max size to meet the demand.

Then @Blacksmoke16 point me to https://github.com/crystal-lang/crystal-db/blob/master/src/db/pool.cr, which is mostly what I was seeking. The implementation looks great by being generic. One issue though: this generic pool is inside the https://github.com/crystal-lang/crystal-db shard, which is [a] “Common db api for crystal”; obviously not what I am doing, I don’t want to have a whole set of modules to just use the Pool object.

Several suggestions:

What the authors think? (@bcardiff and @ysbaddaden )

See https://github.com/crystal-lang/crystal-db/issues/122

We have the policy to try to avoid external Crystal dependencies that are not within crystal-lang organization. If the crystal-db pool evolves enough to be extracted that will be a different story.

crystal-db pool is implemented with db use case in mind. I didn’t want to resolve the generic pool first.

1 Like

Thanks @bcardiff, I didn’t see this issue.