Skip to main content

crawl_fanout

Function crawl_fanout 

Source
async fn crawl_fanout<S>(
    peer_service: S,
    address_book_service: Buffer<BoxService<AddressBookRequest, AddressBookResponse, BoxError>, AddressBookRequest>,
    fanout_limit: Option<usize>,
) -> Result<Option<MorePeers>, BoxError>
where S: Service<Request, Response = Response, Error = BoxError> + Clone + Send + 'static, S::Future: Send + 'static,
Expand description

Crawl the network for more peer addresses, limiting the fanout to fanout_limit.

Opportunistically crawl the network on every call to ensure we’re actively fetching peers. Continue independently of whether we actually receive any peers, but always ask the network for more.

Because requests are load-balanced across existing peers, we can make multiple requests concurrently, which will be randomly assigned to existing peers, but we don’t make too many because crawls may be started while the peer set is already loaded.

§Correctness

This function does not have a timeout. Use the CrawlFanout service instead.