Giter Club home page Giter Club logo

Comments (4)

marten-seemann avatar marten-seemann commented on July 21, 2024

Actually, I'd be in favor of removing the peer.Set altogether. The only consumer I can find is kad-dht (here and here) and the peerstore, where the peerstore isn't even using it in an efficient way.

Therefore, this code should probably live (unexported) inside kad.

from go-libp2p-core.

vgonkivs avatar vgonkivs commented on July 21, 2024

Hi @marten-seemann. Thanks for the explanation. Is it possible to temporary add this functionality(I can open a PR) as it's pretty logic that if there is a possibility to add a peer, then it might have possibility to delete a peer or could suggest what can I use instead of peer.Set(with add/remove peer functionality) if it will be deleted at all? I want to avoid copy pasting in my code

from go-libp2p-core.

marten-seemann avatar marten-seemann commented on July 21, 2024

This seems to be a trivial piece of code, so I'd argue that copy-pasting the parts that you need would actually be the right thing to do.

Also note that the API here is kind of confusing: You can set a size, but that size is not enforced by Add (only by TryAdd).

from go-libp2p-core.

vgonkivs avatar vgonkivs commented on July 21, 2024

ok, thank you.

from go-libp2p-core.

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.