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 connection pid monitoring #65

Merged
merged 1 commit into from
Sep 14, 2019
Merged

Conversation

scarfacedeb
Copy link
Contributor

@scarfacedeb scarfacedeb commented Sep 12, 2019

Start #64.

It should solve the connection monitoring issue with temp files.

I read the cowboy source code and noticed that it always sends the response from the connection process, not the request one.

It means that we have to pass the connection pid from the Plug.Conn down to the Exfile.Tempfile, creating some ugly code as a result. But at least it relies on the least amount of hacks and avoids having separate cleaning worker.

@keichan34 what do you think?

Why:

To monitor cowboy's connection process, instead of request process.

Fixes: keichan34#64
@scarfacedeb
Copy link
Contributor Author

Also, I updated the example app with more tests and better readme: https://github.com/scarfacedeb/exfile_sendfile_example

@keichan34
Copy link
Owner

@scarfacedeb Looks good! I haven't tested it, but it looks like this should work with both Cowboy 1 and 2, right?

@scarfacedeb
Copy link
Contributor Author

@keichan34 Thanks! I checked it and it fallbacks to self() as expected.

@keichan34
Copy link
Owner

I'll merge this and get around to releasing a new version, hopefully this week. Thanks for contributing!

@keichan34 keichan34 merged commit c882885 into keichan34:master Sep 14, 2019
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