Skip to content
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

Timeout policy #893

Merged
merged 4 commits into from
Jul 11, 2022
Merged

Timeout policy #893

merged 4 commits into from
Jul 11, 2022

Conversation

rylev
Copy link
Contributor

@rylev rylev commented Jul 4, 2022

This adds a timeout policy to storage clients.

Now the user can use the context option to specify timeouts as well as set a default timeout for all operations.

Note: the experience for actually setting a timeout is somewhat worse, but this is because the context API is a bit awkward. That needs to be improved independent of this change.

@rylev rylev requested a review from bmc-msft July 4, 2022 13:45
@rylev rylev force-pushed the timeout-policy branch from 10b019d to 61dcba3 Compare July 4, 2022 13:47
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good change insofar that it moves the timeout logic from the specific endpoints to a generalized middleware.

I don't particularly like that this then requires constructing a context object manually which needs to be passed. But that's the design we currently have, and I'm happy to do the work to streamline that part of it.

Either way, keen to have this merged!

@rylev rylev merged commit 73cb677 into Azure:main Jul 11, 2022
@rylev rylev deleted the timeout-policy branch July 11, 2022 10:28
bmc-msft pushed a commit to bmc-msft/azure-sdk-for-rust that referenced this pull request Jul 11, 2022
With multiple PRs landing one on top of each other, not all of the
timeouts as part of the bulider patterns were removed during Azure#893.

These remove all but two that use the Storage crate, both in `data_tables`.

1. TransactionBuilder.  This Builder does not use `setters`, but instead
   provides it's own builder methods to enable adding multiple database
   operations into the single transaction.  It does not need the `setters`
   portion of the operation macro, but should still be a builder.
2. UpdateOrMergeEntityBuilder.  This no longer needs to be a builder, as
   the only optional field is now handled via aforementioned PR.
rylev pushed a commit that referenced this pull request Jul 11, 2022
With multiple PRs landing one on top of each other, not all of the
timeouts as part of the bulider patterns were removed during #893.

These remove all but two that use the Storage crate, both in `data_tables`.

1. TransactionBuilder.  This Builder does not use `setters`, but instead
   provides it's own builder methods to enable adding multiple database
   operations into the single transaction.  It does not need the `setters`
   portion of the operation macro, but should still be a builder.
2. UpdateOrMergeEntityBuilder.  This no longer needs to be a builder, as
   the only optional field is now handled via aforementioned PR.

Co-authored-by: Brian Caswell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants