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

Document API of transport classes #8

Open
mila opened this issue Feb 9, 2023 · 2 comments
Open

Document API of transport classes #8

mila opened this issue Feb 9, 2023 · 2 comments

Comments

@mila
Copy link
Contributor

mila commented Feb 9, 2023

In the hface.connections module, we have a Transport interface implemented by TCPTransport and UDPTransport. These classes combine sans-IO protocols with sockets for IO. These classes are currently not part of the public API because I am not sure about their design. Users have only the Connection class available. This class uses transports internally.

Consider whether we need separate classes for connections and transports and what their interface should be. Once the interface is decided, document it.

@mila
Copy link
Contributor Author

mila commented Feb 9, 2023

Having one Connection class (not interface) with undocumented transports used constructor means users of hface cannot replace the lowest protocol layer. In an idea case, it should be possible to provide own Connection (or Transport) implementations that would replace both the sans-IO protocol and AnyIO socket handling.

@mila
Copy link
Contributor Author

mila commented Feb 9, 2023

One design detail I am not sure about: Connection references Transport, which references HTTPProtocol. That alone would be OK, but Connection sometimes calls Transport methods and sometime accesses directly HTTPProtocol.

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

No branches or pull requests

1 participant