Giter VIP home page Giter VIP logo

Comments (6)

matzew avatar matzew commented on June 18, 2024

backwards compatible version, separate interface

seems like a safe harbor

from sdk-go.

alanconway avatar alanconway commented on June 18, 2024

I have a rethink on the solution to this: "Ready" is a very transport-specific concept, some transports might not even have such a phase. So instead of adding this to the Tranport interface, I propose to update the HTTP transport (and any others with similar issues) as follows:

l := net.Listen(...)
transport := http.New(WithListener(l))

That gives the user full control (if they wish) over the listener, including the ability to get a Listen(":0") address from l.Addr(). It also allows listening on specific interfaces on a multi-homed host (which is currently impossible) and listening specifically for tpc6 or tcp4 trafic. And it is backwards compatible :)

We'd want to encourage something similar on any transport that uses a listener, I'll have a look at the existing ones.

from sdk-go.

n3wscott avatar n3wscott commented on June 18, 2024

you can already give port 0 in http options.

Let me look more at this...

from sdk-go.

alanconway avatar alanconway commented on June 18, 2024

from sdk-go.

n3wscott avatar n3wscott commented on June 18, 2024

I wonder if this is a time to introduce message channels that can be passed to the transport via options. An error channel and an fyi channel? (in addition to the PR you have pending).

Then the FYI channel could send a transport state update messages. (Ready, Failed, restarting...?)

from sdk-go.

alanconway avatar alanconway commented on June 18, 2024

from sdk-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.