Open mila opened 1 year ago
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.
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
.
In the
hface.connections
module, we have aTransport
interface implemented byTCPTransport
andUDPTransport
. 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 theConnection
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.