pub fn wait_txns(&self, senders: &[AccountData]) -> (HashMap<AccountAddress, u64>, u128) {
        let account_chunks = divide_items(senders, self.clients.len());
        let now = time::Instant::now();
        let children: Vec<thread::JoinHandle<HashMap<_, _>>> = account_chunks
            .zip(self.clients.iter().cycle())
            .map(|(chunk, client)| {
                let local_chunk = Vec::from(chunk);
                let local_client = Arc::clone(client);
                info!(
                    "Dispatch a chunk of {} accounts to client.",
                    local_chunk.len()
                );
                thread::spawn(move || -> HashMap<AccountAddress, u64> {
                    sync_account_sequence_number(&local_client, &local_chunk)
                })
            })
            .collect();
        let mut sequence_numbers: HashMap<AccountAddress, u64> = HashMap::new();
        for child in children {
            let sequence_number_chunk = child.join().expect("failed to join a wait thread");
            sequence_numbers.extend(sequence_number_chunk);
        }
        let wait_duration_ms = now.elapsed().as_millis();
        info!("Waited for TXNs for {} ms", wait_duration_ms);
        (sequence_numbers, wait_duration_ms)
    }
/// Wait for accepted TXNs to commit or time out: for any account, if its sequence number
/// (bumpped during TXN generation) equals the one synchronized from validator,
/// denoted as sync sequence number, then all its TXNs are committed.
/// Return senders' most up-to-date sync sequence numbers and how long we have waited.
Wait for accepted TXNs to commit or time out: for any account, if its sequence number
(bumpped during TXN generation) equals the one synchronized from validator,
denoted as sync sequence number, then all its TXNs are committed.
Return senders' most up-to-date sync sequence numbers and how long we have waited.
Wait for accepted TXNs to commit or time out : for any account if its sequence number ( bumpped during TXN generation ) equals the one synchronized from validator denoted as sync sequence number then all its TXNs are committed . Return senders ' most up - to - date sync sequence numbers and how long we have waited .
pub fn wait_txns(&self, senders: &[AccountData]) -> (HashMap<AccountAddress, u64>, u128) {
        let account_chunks = divide_items(senders, self.clients.len());
        let now = time::Instant::now();
        let children: Vec<thread::JoinHandle<HashMap<_, _>>> = account_chunks
            .zip(self.clients.iter().cycle())
            .map(|(chunk, client)| {
                let local_chunk = Vec::from(chunk);
                let local_client = Arc::clone(client);
                info!(
                    "Dispatch a chunk of {} accounts to client.",
                    local_chunk.len()
                );
                thread::spawn(move || -> HashMap<AccountAddress, u64> {
                    sync_account_sequence_number(&local_client, &local_chunk)
                })
            })
            .collect();
        let mut sequence_numbers: HashMap<AccountAddress, u64> = HashMap::new();
        for child in children {
            let sequence_number_chunk = child.join().expect("failed to join a wait thread");
            sequence_numbers.extend(sequence_number_chunk);
        }
        let wait_duration_ms = now.elapsed().as_millis();
        info!("Waited for TXNs for {} ms", wait_duration_ms);
        (sequence_numbers, wait_duration_ms)
    }
pub fn wait_txns ( & self , senders : & [ AccountData ] ) -> ( HashMap < AccountAddress , u64 > , u128 ) { let account_chunks = divide_items ( senders , self . clients . len ( ) ) ; let now = time :: Instant :: now ( ) ; let children : Vec < thread :: JoinHandle < HashMap < _ , _ > > > = account_chunks . zip ( self . clients . iter ( ) . cycle ( ) ) . map ( | ( chunk , client ) | { let local_chunk = Vec :: from ( chunk ) ; let local_client = Arc :: clone ( client ) ; info ! ( " " local_chunk len ( ) ) ; thread :: spawn ( move | | -> HashMap < AccountAddress , u64 > { sync_account_sequence_number ( & local_client , & local_chunk ) } ) } ) . collect ( ) ; let mut sequence_numbers : HashMap < AccountAddress , u64 > = HashMap :: new ( ) ; for child in children { let sequence_number_chunk = child . join ( ) . expect ( " " ) ; sequence_numbers . extend ( sequence_number_chunk ) ; } let wait_duration_ms = now . elapsed ( ) . as_millis ( ) ; info ! ( " " wait_duration_ms ) ; ( sequence_numbers , wait_duration_ms ) }
Wait for accepted TXNs to commit or time out: for any account, if its sequence number
(bumpped during TXN generation) equals the one synchronized from validator,
denoted as sync sequence number, then all its TXNs are committed.
Wait for accepted TXNs to commit or time out : for any account if its sequence number ( bumpped during TXN generation ) equals the one synchronized from validator denoted as sync sequence number then all its TXNs are committed .
&self
senders
&[AccountData]
&self
senders
&[AccountData]