Skip to content

Question regarding PeerDiscovery api #38

@bearsh

Description

@bearsh

Hi, I'm about to use this library in a client-server project where the client should be able to discover servers in the lan.

I looked at the PeerDiscovery object and its attached methods. For me, it's strange how it is implemented. NewPeerDiscovery() creates this object and does a peer discover in a blocking way. Still PeerDiscovery has a Shutdown() method to stop discovery. But how should this work, if the object creation is blocking until discovering has been finished?

Wouldn't it be better to create the option, have a Serve() and Shutdown() method and get the notification about new peer via callback (or channel)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions