introduce new runtime tokio helpers

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2020-01-20 12:52:22 +01:00
parent aac9dbf635
commit d973aa827c
13 changed files with 173 additions and 43 deletions

View File

@ -21,9 +21,8 @@ async fn upload_speed() -> Result<usize, Error> {
Ok(res)
}
#[tokio::main]
async fn main() {
match upload_speed().await {
fn main() {
match proxmox_backup::tools::runtime::main(upload_speed()) {
Ok(mbs) => {
println!("average upload speed: {} MB/s", mbs);
}