pub fn garbage_collect_edges(&self) {
    let mut inner = self.inner.lock();
    inner.pg = inner.pg.filter_map(
      |_entry_id, node| Some(node.clone()),
      |edge_index, edge_weight| {
        let (edge_src_id, _) = inner.pg.edge_endpoints(edge_index).unwrap();
        // Retain the edge if it is for either the current or previous run of a Node.
        if inner.pg[edge_src_id]
          .run_token()
          .equals_current_or_previous(edge_weight.1)
        {
          Some(*edge_weight)
        } else {
          None
        }
      },
    );
  }
///
/// Garbage collects all dependency edges that are not associated with the previous or current run
/// of a Node. Node cleaning consumes the previous edges for an operation, so we preserve those.
///
/// This is executed as a bulk operation, because individual edge removals take O(n), and bulk
/// edge filtering is both more efficient, and possible to do asynchronously. This method also
/// avoids the `retain_edges` method, which as of petgraph `0.4.5` uses individual edge removals
/// under the hood, and is thus not much faster than removing them one by one.
///
///   See https://github.com/petgraph/petgraph/issues/299.
///
Garbage collects all dependency edges that are not associated with the previous or current run
of a Node. Node cleaning consumes the previous edges for an operation, so we preserve those.

This is executed as a bulk operation, because individual edge removals take O(n), and bulk
edge filtering is both more efficient, and possible to do asynchronously. This method also
avoids the `retain_edges` method, which as of petgraph `0.4.5` uses individual edge removals
under the hood, and is thus not much faster than removing them one by one.


Garbage collects all dependency edges that are not associated with the previous or current run of a Node . Node cleaning consumes the previous edges for an operation so we preserve those . This is executed as a bulk operation because individual edge removals take O ( n ) and bulk edge filtering is both more efficient and possible to do asynchronously . This method also avoids the ` retain_edges ` method which as of petgraph ` 0 . 4 . 5 ` uses individual edge removals under the hood and is thus not much faster than removing them one by one .
pub fn garbage_collect_edges(&self) {
    let mut inner = self.inner.lock();
    inner.pg = inner.pg.filter_map(
      |_entry_id, node| Some(node.clone()),
      |edge_index, edge_weight| {
        let (edge_src_id, _) = inner.pg.edge_endpoints(edge_index).unwrap();
        // Retain the edge if it is for either the current or previous run of a Node.
        if inner.pg[edge_src_id]
          .run_token()
          .equals_current_or_previous(edge_weight.1)
        {
          Some(*edge_weight)
        } else {
          None
        }
      },
    );
  }
pub fn garbage_collect_edges ( & self ) { let mut inner = self . inner . lock ( ) ; inner . pg = inner . pg . filter_map ( | _entry_id , node | Some ( node . clone ( ) ) , | edge_index , edge_weight | { let ( edge_src_id , _ ) = inner . pg . edge_endpoints ( edge_index ) . unwrap ( ) ; // Retain the edge if it is for either the current or previous run of a Node. if inner . pg [ edge_src_id ] . run_token ( ) . equals_current_or_previous ( edge_weight . 1 ) { Some ( * edge_weight ) } else { None } } , ) ; }
Garbage collects all dependency edges that are not associated with the previous or current run
of a Node.
Garbage collects all dependency edges that are not associated with the previous or current run of a Node .
&self
&self