ockam
ockam copied to clipboard
Mitigate code duplication in WebSocket and Tcp transports
Mitigate code duplication in WebSocket and Tcp transports. For example TcpRouter and WebSocketRouter are identical, except log messages and return errors. Let's consider moving essential parts of Transport implementations to a separate place.
I'd like to do this. Do you have anything in mind? Extract common stuff to a new crate?
@adrianbenavides I'm currently adding lazy connections and dns resolution support to tcp, which heavily affects code structure. I'll ping you, after I'm done with that. And yes, I think we could extract core functionality to a separate crate, possibly called "ockam_transport", that will be used from tcp and websocket crates. Those two have ~90% of code in common, I wonder how Router, WorkerPair, etc. would look like for BLE, UDP, etc. Ideally, those future transport implementations should be able to use new ockam_transport crate as much as possible
Thanks for your help!
sounds great, thank you @SanjoDeundiak!