nanomsg / mangos-v1

The pure golang implementation of nanomsg (version 1, frozen)
Apache License 2.0
1.53k stars 119 forks source link

Transport and binding agnostics #278

Closed joeblew99 closed 6 years ago

joeblew99 commented 7 years ago

It would be nice to have an agnostic interface for using mangos with different transports and binding.

Have you all seen the multi-formats library from the same organisation that is doing IPFS ? The reason i bring it up is because they have a agnostic golang library that can use different transports and bindings. Its also well used.

Main web site: https://protocol.ai/projects/

The 2 projects within the org i want to bring up: https://protocol.ai/projects/#Libp2p https://protocol.ai/projects/#Multiformats

Code: https://github.com/libp2p https://github.com/multiformats https://github.com/multiformats/multicodec


Related: https://github.com/whyrusleeping?tab=repositories

https://github.com/marten-seemann/libp2p-quic-transport

gdamore commented 7 years ago

I'm not sure how such an "agnostic" thing would work at all -- mangos clients and servers need to know how to reach each other, and that means that they have to agree which protocol they are going to use, and the client needs to know how to reach the server. (E.g. what port it is listening on, etc.) . This stuff is baked in to the mangos/nanomsg URL.

You could build some sort of hybrid transport that makes use of a bunch of different underlying protocols (the clients and server would still need to agree somehow), and offer that as a new transport type in mangos. I welcome such experimentation, even if I'm not particularly bullish on it myself.

Adding new transports to mangos is super easy -- at least for transports that present a connection based paradigm. So for example, adding kcp should only take a day or so. (Probably only a couple of hours.) The transport interface is quite nice and pluggable; and indeed this is one area where I had hoped that others would find that they could contribute new stuff.

Sadly adding new transports to nanomsg (not mangos) is quite a lot more challenging. I'm working on a new library (libnng) that should address that in C, and should be lots easier to create new transports for.

Stay tuned on that front.

joeblew99 commented 7 years ago

Would not go-kit be a good option for transport agnostics ? I have used it specifically for that aim. It's 100% golang too which is important.

Adding kcr would be very nice too for sure

gdamore commented 6 years ago

Ok, I'm closing this issue as we're not going to refactor this project around go-kit or anything like that. If folks want to ask for specific transports (e.g. kcp), I'm happy for those issues to be filed and addressed as they come up.