Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a maximum connection age #98

Open
edevil opened this issue May 15, 2017 · 3 comments
Open

Support a maximum connection age #98

edevil opened this issue May 15, 2017 · 3 comments

Comments

@edevil
Copy link

edevil commented May 15, 2017

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.

@edgurgel
Copy link

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?

@edevil
Copy link
Author

edevil commented May 19, 2017

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.

@Vagabond
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants