NimblePool + Redix - why do all Redix pooling libraries use Poolboy instead?

I love NimblePool and use it frequently. I’m curious why all Redix pooling libraries use Poolboy instead.

From the NimblePool docs…

you can act directly on the resource, avoiding the data copying, but you need to keep the state of the resource in sync with the process

I take that to mean that you have to make sure the resource is in a good state before returning it via checkout. Which is fine; NimblePool has callbacks to ensure your resource is good before handing them out. I.e. if a Redix process is dead, you can use a NimblePool callback to create a new one.

NimblePool may not be a good option to manage processes.

Why? I understand that the pool itself can become a bottleneck, but that’s easily handled by having multiple pools and randomly selecting one to use.

Thanks for the help.

2 Likes

Great question! Answer added to the README:

NimblePool may not be a good option to manage processes. After all, the goal of NimblePool is to avoid creating processes for resources. If you already have a process, using a process-based pool such as poolboy will provide a better abstraction.

4 Likes

Can somebody give me an example how exactly is NimblePool an actual pool? I’ve read part of its source code and it looks to do exactly the opposite of a pool to me – namely it serializes access to single state / resource.

:thinking: