Created
January 11, 2023 04:03
-
-
Save Enigo/f255d40094e09f9bf3ac838cc50f71f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub async fn read_orders() { | |
let response = fetch_api_response::<Order>(ORDERS_URL).await; | |
match response { | |
Ok(order) => { | |
info!("Processing order response"); | |
let mut futures = vec![]; | |
for result in order.result { | |
let future = task::spawn(process_order(result)); | |
futures.push(future); | |
} | |
join_all(futures).await; | |
} | |
Err(e) => { ... } | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment