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

Enable usage of async foreach on SF IAsyncEnumerable #470

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndreyTretyak
Copy link

@AndreyTretyak AndreyTretyak commented Apr 17, 2020

This change will allow using ServiceFabric.Data.IAsyncEnumerable<T> in the async foreach, since it uses duck typing.
So instead of manually working with enumerator we can write:

async Task SomeMethond(ServiceFabric.Data.IAsyncEnumerable<T> asyncEnumerable)
{
  await foreach(var item in asyncEnumerable)
  {
     /*  Some code that use item variable */
  }
}

This will NOT allow using the extension method of System.Collection.Generic.IAsyncEnumerable<T> like WithCancelation or ConfigureAwait in order to do that interface needs to be implemented.

This change could help with following issue #406

@AndreyTretyak AndreyTretyak marked this pull request as ready for review April 17, 2020 19:23
@AndreyTretyak
Copy link
Author

AndreyTretyak commented Apr 20, 2020

@bpm-ms @anmolah @samedder could you please have a look?

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.

None yet

1 participant