pub(crate) async fn run_link_status_updater(
    observable: Observable<BTreeMap<NodeId, LinkMetrics>>,
    receiver: LinkStateReceiver,
) -> Result<(), Error> {
    let link_status = Observable::new(LinkStatusMap::new());
    let link_status_observer = link_status.new_observer();
    futures::future::join(collate(receiver, link_status), reduce(link_status_observer, observable))
        .await;
    Ok(())
}
/// The link status updater handles changes to the status of links. "Status" here means whether the
/// link is up or down, as well as the current ping time of the link as used for routing.
///
/// The [`LinkStateReceiver`] is a channel that will give us an [`Observer`] for each new link as it
/// is connected. The `Observer` contains an `Option<Duration>` where the duration given is the RTT
/// of that link. The option becomes `None` if the link becomes disconnected.
///
/// The link state is updated into the `observable` argument, which contains a `BTreeMap`
/// associating node IDs to information about the link to that node.
The link status updater handles changes to the status of links. "Status" here means whether the
link is up or down, as well as the current ping time of the link as used for routing.

The [`LinkStateReceiver`] is a channel that will give us an [`Observer`] for each new link as it
is connected. The `Observer` contains an `Option` where the duration given is the RTT
of that link. The option becomes `None` if the link becomes disconnected.

The link state is updated into the `observable` argument, which contains a `BTreeMap`
associating node IDs to information about the link to that node.
The link status updater handles changes to the status of links . " Status " here means whether the link is up or down as well as the current ping time of the link as used for routing . The [ ` LinkStateReceiver ` ] is a channel that will give us an [ ` Observer ` ] for each new link as it is connected . The ` Observer ` contains an ` Option ` where the duration given is the RTT of that link . The option becomes ` None ` if the link becomes disconnected . The link state is updated into the ` observable ` argument which contains a ` BTreeMap ` associating node IDs to information about the link to that node .
pub(crate) async fn run_link_status_updater(
    observable: Observable<BTreeMap<NodeId, LinkMetrics>>,
    receiver: LinkStateReceiver,
) -> Result<(), Error> {
    let link_status = Observable::new(LinkStatusMap::new());
    let link_status_observer = link_status.new_observer();
    futures::future::join(collate(receiver, link_status), reduce(link_status_observer, observable))
        .await;
    Ok(())
}
pub ( crate ) async fn run_link_status_updater ( observable : Observable < BTreeMap < NodeId , LinkMetrics > > , receiver : LinkStateReceiver , ) -> Result < ( ) , Error > { let link_status = Observable :: new ( LinkStatusMap :: new ( ) ) ; let link_status_observer = link_status . new_observer ( ) ; futures :: future :: join ( collate ( receiver , link_status ) , reduce ( link_status_observer , observable ) ) . await ; Ok ( ( ) ) }
The link status updater handles changes to the status of links.
The link status updater handles changes to the status of links .
observable
Observable<BTreeMap<NodeId, LinkMetrics>>
receiver
LinkStateReceiver
observable
Observable<BTreeMap<NodeId, LinkMetrics>>
receiver
LinkStateReceiver