Skip to main content

concurrent_query

Function concurrent_query 

Source
pub async fn concurrent_query<F, T>(
    queries: impl Iterator<Item = F>,
) -> Vec<RocketMQResult<T>> 
where F: Future<Output = RocketMQResult<T>>,
Expand description

Execute multiple async operations concurrently

§Example

let results = concurrent_query(topics.iter().map(|topic| {
    let admin = admin.clone();
    let topic = topic.clone();
    async move {
        admin.examine_topic_route_info(topic).await
    }
})).await;