poolboy
poolboy copied to clipboard
Support a maximum connection age
I did not find this in the documentation, but it would be great if we could specify a maximum connection age so that connections are terminated and new ones are started after some time.
One can achieve this by sending a message to self after X seconds. When this message arrives, :stop
and the GenServer (considering you are using a GenServer) will terminate. Poolboy will start a new server. Would this solve your problem?
This seems like it would solve my problem, but the pool object itself is being managed by ecto, I don't know if I'm able to even figure out the correct pids to send messages to.
When the worker is starting, in the init function, it uses send_after to message self() after some max age.
If you can't do that because of ecto, what access does ecto give to you to configure poolboy?