fn await_held_agent_ids(config: Configuration, signal_rx: &SignalReceiver) {
    let mut agent_addresses: HashSet<String> = config
        .agents
        .iter()
        .map(|c| c.public_address.to_string())
        .collect();
    loop {
        if let Ok(Signal::Trace(aw)) = signal_rx.recv_timeout(Duration::from_millis(10)) {
            let action = aw.action();
            if let Action::Hold(EntryWithHeader {
                entry: Entry::AgentId(id),
                header: _,
            }) = action
            {
                agent_addresses.remove(&id.pub_sign_key);
            }
            if agent_addresses.is_empty() {
                break;
            }
        }
    }
}
/// Block until Hold(agent.public_address) is seen for each agent in the conductor.
/// NOTE that this consumes a bunch of signals related to initialization!
/// The `Waiter` currently doesn't care about these, but beware.
Block until Hold(agent.public_address) is seen for each agent in the conductor.
NOTE that this consumes a bunch of signals related to initialization.
The `Waiter` currently doesn't care about these, but beware.
Block until Hold ( agent . public_address ) is seen for each agent in the conductor . NOTE that this consumes a bunch of signals related to initialization . The ` Waiter ` currently doesn ' t care about these but beware .
fn await_held_agent_ids(config: Configuration, signal_rx: &SignalReceiver) {
    let mut agent_addresses: HashSet<String> = config
        .agents
        .iter()
        .map(|c| c.public_address.to_string())
        .collect();
    loop {
        if let Ok(Signal::Trace(aw)) = signal_rx.recv_timeout(Duration::from_millis(10)) {
            let action = aw.action();
            if let Action::Hold(EntryWithHeader {
                entry: Entry::AgentId(id),
                header: _,
            }) = action
            {
                agent_addresses.remove(&id.pub_sign_key);
            }
            if agent_addresses.is_empty() {
                break;
            }
        }
    }
}
fn await_held_agent_ids ( config : Configuration , signal_rx : & SignalReceiver ) { let mut agent_addresses : HashSet < String > = config . agents . iter ( ) . map ( | c | c . public_address . to_string ( ) ) . collect ( ) ; loop { if let Ok ( Signal :: Trace ( aw ) ) = signal_rx . recv_timeout ( Duration :: from_millis ( 10 ) ) { let action = aw . action ( ) ; if let Action :: Hold ( EntryWithHeader { entry : Entry :: AgentId ( id ) , header : _ , } ) = action { agent_addresses . remove ( & id . pub_sign_key ) ; } if agent_addresses . is_empty ( ) { break ; } } } }
Block until Hold(agent.public_address) is seen for each agent in the conductor.
Block until Hold ( agent . public_address ) is seen for each agent in the conductor .
config
Configuration
signal_rx
&SignalReceiver
config
Configuration
signal_rx
&SignalReceiver