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

Revisit ReadThroughput api for single return type #797

Open
simplynaveen20 opened this issue Sep 12, 2019 · 1 comment
Open

Revisit ReadThroughput api for single return type #797

simplynaveen20 opened this issue Sep 12, 2019 · 1 comment
Labels
Required for V4 GA VNext Next Major version of SDK

Comments

@simplynaveen20
Copy link
Member

We have two public api for throughput, one return nullable int and other return ThroughputResponse, they are getting differentiate based on requestOptions.
We did this for simple use case where user will just need call ReadThroughputAsync without requestOption , and if user need the whole response which have other properties in it ,they can pass the requestOption
and it will be in line with our other read responses where one case pass etag and other request options.
Problem here is user working on ThroughputResponse had to pass the requestOptions as we don’t have a default value for it.
Idea here is merging both these api together having default null requestOptions and implicit conversion for int?.

public abstract Task<int?> ReadThroughputAsync(
CancellationToken cancellationToken = default(CancellationToken));

public abstract Task ReadThroughputAsync(
RequestOptions requestOptions,

@kirankumarkolli kirankumarkolli added VNext Next Major version of SDK and removed Required for V4 GA labels Sep 12, 2019
@deborahc
Copy link

+1. Currently you can pass in empty RequestOptions() to see the other properties (MinThroughput, IsReplacePending), which isn't intuitive.

 // Scale down the database to the minimum RU/s. 
var currentThroughput = await partitioningDemoDB.ReadThroughputAsync(requestOptions: new RequestOptions());
int minThroughput = (int)currentThroughput.MinThroughput;
var throughputResponse = await partitioningDemoDB.ReplaceThroughputAsync(minThroughput);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Required for V4 GA VNext Next Major version of SDK
Projects
None yet
Development

No branches or pull requests

3 participants