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

Wrap channel in an asyncio.Transport to eliminate loop back connection PoC #303

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

bdraco
Copy link

@bdraco bdraco commented Oct 24, 2024

The concept is that the SelectorTransport is replaced with the new ChannelTransport that is a wrapper around the channel so we don't need to connect back to localhost since we can create the request handler, connect up the transport and protocol and start_tls. It could be a bit more efficient if the channel became an asyncio.Transport but its already more efficient anyways because it eliminated the loopback connection so one less copy.

Also since aiohttp gets the ip address from the transport it can be set to whatever is desired

@bdraco bdraco changed the title Direct connect PoC Wrap channel in an asyncio.Transport to eliminate loop back connection PoC Oct 24, 2024
try:
from_peer = await self._channel.read()
except MultiplexerTransportClose:
raise
Copy link
Author

Choose a reason for hiding this comment

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

Pretty sure connect lost will always get called because close on the finally block where this task is awaited but it should get a test

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.

1 participant