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

Add post-listen callback #322

Closed
wants to merge 1 commit into from

Conversation

juhlig
Copy link
Contributor

@juhlig juhlig commented Aug 26, 2021

(Alternative to #321)

This PR introduces a new transport option post_listen which takes a fun of arity 1. This function is called when the listen socket has been created and is given this socket as single argument. The function can then perform any necessary further setup steps on the socket (eg, changing the file permissions of a local socket, as requested in #320). It must return either ok or {error, Reason}.

@essen
Copy link
Member

essen commented Aug 27, 2021

post_listen_callback is more obvious.

src/ranch_acceptors_sup.erl Outdated Show resolved Hide resolved
@juhlig
Copy link
Contributor Author

juhlig commented Aug 27, 2021

Both done in last commit

@essen
Copy link
Member

essen commented Aug 31, 2021

Missing agent will run whenever it's done with its backlog and then we can merge this I think.

@essen
Copy link
Member

essen commented Aug 31, 2021

We should document it with an example that shows setting file permissions specifically.

@juhlig
Copy link
Contributor Author

juhlig commented Aug 31, 2021

We should document it with an example that shows setting file permissions specifically.

Tomorrow :)

@juhlig
Copy link
Contributor Author

juhlig commented Sep 1, 2021

Docs added, please review.

@juhlig juhlig requested a review from essen September 1, 2021 10:36
@essen
Copy link
Member

essen commented Sep 1, 2021

Merged, thanks!

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

Successfully merging this pull request may close these issues.

2 participants