-
Notifications
You must be signed in to change notification settings - Fork 319
into_future for services
#527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| let accounts = batch_account::list(config, subscription_id).await?; | ||
| let accounts = client.batch_account().list(subscription_id).into_future().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| let pools = pool::list_by_batch_account(config, &resource_group_name, &account_name, None, None, None, subscription_id).await?; | ||
| let pools = client | ||
| .pool() | ||
| .list_by_batch_account(resource_group_name, account_name, subscription_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| let vms = virtual_machines::list_all(config, subscription_id, None).await?; | ||
| let vms = client.virtual_machines().list_all(subscription_id).into_future().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| let accounts = storage_accounts::list(config, subscription_id).await?; | ||
| let accounts = client.storage_accounts().list(subscription_id).into_future().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| let clouds = private_clouds::list_in_subscription(config, subscription_id).await?; | ||
| let clouds = client.private_clouds().list_in_subscription(subscription_id).into_future().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| @@ -74,7 +73,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||
| }; | |||
|
|
|||
| println!("creating task"); | |||
| task::add(&config, &job_id, &task, None, None, None, None).await?; | |||
| client.task().add(job_id, task).into_future().await?; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| @@ -50,7 +49,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||
| }; | |||
|
|
|||
| println!("creating job"); | |||
| job::add(&config, &job_params, None, None, None, None).await?; | |||
| client.job().add(job_params).into_future().await?; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
This made my project that uses an SVC crate significantly less cumbersome. Specifically, I was using svc/batch. My code went from this: let result = task::get(&config, &job_id, &task_id, None, None, None, None, None, None, None, None, None, None).await;To this: let result = batch_client.task().get(&job_id, &task_id).into_future().await; |
This is executing on the plan in #520 to use
into_futurefor generated services. It is a major update. This PR:OperationConfig&OperationConfigBuilderwithClientandClientBuilder. Fixes generate Clients for services #50.Builderthat implementsinto_future.into_futureis implemented as originally specified in #510 with:I think the API shape remains the same, but it does not follow what was later specified. It specifies:
Builder::contextnot yet supportedBuilder::insertnot yet supportedIntoFutureis not yet implementedI'd prefer to make those adjustments and additions in another PR.