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

Move async collection to core #7038

Merged
merged 4 commits into from
Jul 29, 2019
Merged

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Jul 29, 2019

Fixes: #6807

I also cleaned up some todos:

TODO: Should this be Items instead of Values?

Values seem fine considering Response.Value

TODO: Should it be IEnumerable?

I doubt we ever going to lazily deserialize items and the array is easy to consume unfortunately it's mutable so I've picked IReadOnlyList as a middle ground.

TODO: Should this be object instead of string?

I think it would add complexity around serializing it into a string that would fall onto customers. Keeping as a string.

Copy link
Member

@tg-msft tg-msft left a comment

Choose a reason for hiding this comment

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

Added a couple open questions, but nothing that needs to block this PR. Looks good!

/// iterate over.
/// </summary>
/// <typeparam name="T">The type of the values.</typeparam>
public abstract class AsyncCollection<T> : IAsyncEnumerable<Response<T>>
Copy link
Member

Choose a reason for hiding this comment

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

Open question - are we going to have a SyncCollection<T> or similar as an indicator to customers that the sync version of GetBlobs() may make 100 requests?

/// <summary>
/// Gets the values in this <see cref="Page{T}"/>.
/// </summary>
public IReadOnlyList<T> Values { get; }
Copy link
Member

Choose a reason for hiding this comment

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

Open question - we've got open issues like #6894 to use T[] (rather than IEnumerable<T> or IReadOnlyList<T>) and it'd be great to be consistent.

@pakrym pakrym merged commit 2134814 into Azure:master Jul 29, 2019
@pakrym pakrym deleted the pakrym/core-async-collection branch July 29, 2019 22:50
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.

Move AsyncCollection into Azure.Core
2 participants