Class MultiplexingDiscovery

  • All Implemented Interfaces:
    PeerDiscovery
    Direct Known Subclasses:
    DnsDiscovery

    public class MultiplexingDiscovery
    extends java.lang.Object
    implements PeerDiscovery
    MultiplexingDiscovery queries multiple PeerDiscovery objects, optionally shuffles their responses and then returns the results, thus selecting randomly between them and reducing the influence of any particular seed. Any that don't respond within the timeout are ignored. Backends are queried in parallel or serially. Backends may block.
    • Constructor Detail

      • MultiplexingDiscovery

        public MultiplexingDiscovery​(Network network,
                                     java.util.List<PeerDiscovery> seeds)
        Will query the given seeds in parallel before producing a merged response.
        Parameters:
        network - The network we are querying for
        seeds - Sources to query in parallel