pub(super) fn maybe_unblock_runtimes_in_cycle(
        &mut self,
        from_id: RuntimeId,
        from_stack: &QueryStack,
        database_key: DatabaseKeyIndex,
        to_id: RuntimeId,
    ) -> (bool, bool) {
        // See diagram in `for_each_cycle_participant`.
        let mut id = to_id;
        let mut key = database_key;
        let mut others_unblocked = false;
        while id != from_id {
            let edge = self.edges.get(&id).unwrap();
            let prefix = edge
                .stack
                .iter()
                .take_while(|p| p.database_key_index != key)
                .count();
            let next_id = edge.blocked_on_id;
            let next_key = edge.blocked_on_key;

            if let Some(cycle) = edge.stack[prefix..]
                .iter()
                .rev()
                .find_map(|aq| aq.cycle.clone())
            {
                // Remove `id` from the list of runtimes blocked on `next_key`:
                self.query_dependents
                    .get_mut(&next_key)
                    .unwrap()
                    .retain(|r| *r != id);

                // Unblock runtime so that it can resume execution once lock is released:
                self.unblock_runtime(id, WaitResult::Cycle(cycle));

                others_unblocked = true;
            }

            id = next_id;
            key = next_key;
        }

        let prefix = from_stack
            .iter()
            .take_while(|p| p.database_key_index != key)
            .count();
        let this_unblocked = from_stack[prefix..].iter().any(|aq| aq.cycle.is_some());

        (this_unblocked, others_unblocked)
    }
/// Unblock each blocked runtime (excluding the current one) if some
/// query executing in that runtime is participating in cycle fallback.
///
/// Returns a boolean (Current, Others) where:
/// * Current is true if the current runtime has cycle participants
///   with fallback;
/// * Others is true if other runtimes were unblocked.
Unblock each blocked runtime (excluding the current one) if some
query executing in that runtime is participating in cycle fallback.

Returns a boolean (Current, Others) where:
Current is true if the current runtime has cycle participants
with fallback;
Others is true if other runtimes were unblocked.
Unblock each blocked runtime ( excluding the current one ) if some query executing in that runtime is participating in cycle fallback . Returns a boolean ( Current Others ) where : Current is true if the current runtime has cycle participants with fallback ; Others is true if other runtimes were unblocked .
pub(super) fn maybe_unblock_runtimes_in_cycle(
        &mut self,
        from_id: RuntimeId,
        from_stack: &QueryStack,
        database_key: DatabaseKeyIndex,
        to_id: RuntimeId,
    ) -> (bool, bool) {
        // See diagram in `for_each_cycle_participant`.
        let mut id = to_id;
        let mut key = database_key;
        let mut others_unblocked = false;
        while id != from_id {
            let edge = self.edges.get(&id).unwrap();
            let prefix = edge
                .stack
                .iter()
                .take_while(|p| p.database_key_index != key)
                .count();
            let next_id = edge.blocked_on_id;
            let next_key = edge.blocked_on_key;
            if let Some(cycle) = edge.stack[prefix..]
                .iter()
                .rev()
                .find_map(|aq| aq.cycle.clone())
            {
                // Remove `id` from the list of runtimes blocked on `next_key`:
                self.query_dependents
                    .get_mut(&next_key)
                    .unwrap()
                    .retain(|r| *r != id);
                // Unblock runtime so that it can resume execution once lock is released:
                self.unblock_runtime(id, WaitResult::Cycle(cycle));
                others_unblocked = true;
            }
            id = next_id;
            key = next_key;
        }
        let prefix = from_stack
            .iter()
            .take_while(|p| p.database_key_index != key)
            .count();
        let this_unblocked = from_stack[prefix..].iter().any(|aq| aq.cycle.is_some());
        (this_unblocked, others_unblocked)
    }
pub ( super ) fn maybe_unblock_runtimes_in_cycle ( & mut self , from_id : RuntimeId , from_stack : & QueryStack , database_key : DatabaseKeyIndex , to_id : RuntimeId , ) -> ( bool , bool ) { // See diagram in `for_each_cycle_participant`. let mut id = to_id ; let mut key = database_key ; let mut others_unblocked = false ; while id != from_id { let edge = self . edges . get ( & id ) . unwrap ( ) ; let prefix = edge . stack . iter ( ) . take_while ( | p | p . database_key_index != key ) . count ( ) ; let next_id = edge . blocked_on_id ; let next_key = edge . blocked_on_key ; if let Some ( cycle ) = edge . stack [ prefix .. ] . iter ( ) . rev ( ) . find_map ( | aq | aq . cycle . clone ( ) ) { // Remove `id` from the list of runtimes blocked on `next_key`: self . query_dependents . get_mut ( & next_key ) . unwrap ( ) . retain ( | r | * r != id ) ; // Unblock runtime so that it can resume execution once lock is released: self . unblock_runtime ( id , WaitResult :: Cycle ( cycle ) ) ; others_unblocked = true ; } id = next_id ; key = next_key ; } let prefix = from_stack . iter ( ) . take_while ( | p | p . database_key_index != key ) . count ( ) ; let this_unblocked = from_stack [ prefix .. ] . iter ( ) . any ( | aq | aq . cycle . is_some ( ) ) ; ( this_unblocked , others_unblocked ) }
Unblock each blocked runtime (excluding the current one) if some
query executing in that runtime is participating in cycle fallback.
Unblock each blocked runtime ( excluding the current one ) if some query executing in that runtime is participating in cycle fallback .
&mut self
from_id
RuntimeId
from_stack
&QueryStack
database_key
DatabaseKeyIndex
to_id
RuntimeId
&mut self
from_id
RuntimeId
from_stack
&QueryStack
database_key
DatabaseKeyIndex
to_id
RuntimeId