IAsyncEnumerable.cs 967 B

12345678910111213141516171819202122
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. // See https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md for the definition of this interface
  5. // and the design rationale. (8/30/2017)
  6. namespace System.Collections.Generic
  7. {
  8. /// <summary>
  9. /// Asynchronous version of the <see cref="IEnumerable{T}"/> interface, allowing elements of the enumerable sequence to be retrieved asynchronously.
  10. /// </summary>
  11. /// <typeparam name="T">Element type.</typeparam>
  12. public interface IAsyncEnumerable<out T>
  13. {
  14. /// <summary>
  15. /// Gets an asynchronous enumerator over the sequence.
  16. /// </summary>
  17. /// <returns>Enumerator for asynchronous enumeration over the sequence.</returns>
  18. IAsyncEnumerator<T> GetAsyncEnumerator();
  19. }
  20. }