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

Implement runner.addresses property #3037

Merged
merged 1 commit into from
May 31, 2018
Merged

Implement runner.addresses property #3037

merged 1 commit into from
May 31, 2018

Conversation

asvetlov
Copy link
Member

Fix #3036

@codecov-io
Copy link

codecov-io commented May 30, 2018

Codecov Report

Merging #3037 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3037      +/-   ##
==========================================
- Coverage   98.13%   98.09%   -0.04%     
==========================================
  Files          42       42              
  Lines        7721     7723       +2     
  Branches     1345     1346       +1     
==========================================
- Hits         7577     7576       -1     
- Misses         49       51       +2     
- Partials       95       96       +1
Impacted Files Coverage Δ
aiohttp/web_runner.py 100% <100%> (ø) ⬆️
aiohttp/tcp_helpers.py 89.28% <0%> (-7.15%) ⬇️
aiohttp/client_reqrep.py 97.41% <0%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfe7582...1891b82. Read the comment docs.

@hynek
Copy link
Contributor

hynek commented May 30, 2018

How about returning the addresses as ipaddress? It might be worthwhile to go the extra mile and define IPEndpoint(ip, port) and UNIXEndpoint(path) to make it more elegant to detect which is which?

@asvetlov
Copy link
Member Author

IPEndpoint(ipaddress, int) or UNIXEndpoint(str)?

@hynek
Copy link
Contributor

hynek commented May 30, 2018

👍

I don’t know how Endpoint fits into aiothttp’s naming but yeah. That looks good. Gonna be really easy to implement with attrs. ;)

@asvetlov
Copy link
Member Author

asvetlov commented May 30, 2018

Hmm. IPv6 has additional flow_info and scope_id.
I have not enough information how people use it but suspect keeping everything is essential.
My motivation is: let's support the same naming structures as well-known socket module do.
Later we can invent a better API by adding .endpoints property :)

@@ -148,12 +148,18 @@ def __init__(self, *, handle_signals=False, **kwargs):
self._handle_signals = handle_signals
self._kwargs = kwargs
self._server = None
self._sites = set()
self._sites = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asvetlov what is the motivation behind this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep a stable order of returned addresses.
Registering a new site in a runner is not a bottleneck, we can live with O(n) for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. I just didn't know why you'd do this without any comments or commit description :)

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access to socket information when using AppRunner
4 participants