fn __produce_messages(conn_pool: &mut network::Connections,
                      reqs: HashMap<&str, protocol::ProduceRequest>,
                      no_acks: bool)
                      -> Result<Vec<TopicPartitionOffset>> {
    let now = Instant::now();
    if no_acks {
        for (host, req) in reqs {
            try!(__send_noack::<_, protocol::ProduceResponse>(conn_pool, host, now, req));
        }
        Ok(vec![])
    } else {
        let mut res: Vec<TopicPartitionOffset> = vec![];
        for (host, req) in reqs {
            let resp =
                try!(__send_receive::<_, protocol::ProduceResponse>(conn_pool, &host, now, req));
            for tpo in resp.get_response() {
                res.push(tpo);
            }
        }
        Ok(res)
    }
}
/// ~ carries out the given produce requests and returns the response
~ carries out the given produce requests and returns the response
~ carries out the given produce requests and returns the response
fn __produce_messages(conn_pool: &mut network::Connections,
                      reqs: HashMap<&str, protocol::ProduceRequest>,
                      no_acks: bool)
                      -> Result<Vec<TopicPartitionOffset>> {
    let now = Instant::now();
    if no_acks {
        for (host, req) in reqs {
            try!(__send_noack::<_, protocol::ProduceResponse>(conn_pool, host, now, req));
        }
        Ok(vec![])
    } else {
        let mut res: Vec<TopicPartitionOffset> = vec![];
        for (host, req) in reqs {
            let resp =
                try!(__send_receive::<_, protocol::ProduceResponse>(conn_pool, &host, now, req));
            for tpo in resp.get_response() {
                res.push(tpo);
            }
        }
        Ok(res)
    }
}
fn __produce_messages ( conn_pool : & mut network :: Connections , reqs : HashMap < & str , protocol :: ProduceRequest > , no_acks : bool ) -> Result < Vec < TopicPartitionOffset > > { let now = Instant :: now ( ) ; if no_acks { for ( host , req ) in reqs { try ! ( __send_noack protocol ProduceResponse ( conn_pool host now req ) ) ; } Ok ( vec ! [ ] ) } else { let mut res : Vec < TopicPartitionOffset > = vec ! [ ] ; for ( host , req ) in reqs { let resp = try ! ( __send_receive protocol ProduceResponse ( conn_pool host now req ) ) ; for tpo in resp . get_response ( ) { res . push ( tpo ) ; } } Ok ( res ) } }
~ carries out the given produce requests and returns the response
~ carries out the given produce requests and returns the response
conn_pool
&mut network::Connections
reqs
HashMap<&str, protocol::ProduceRequest>
no_acks
bool