IAwaiter.cs 1.0 KB

12345678910111213141516171819202122232425262728
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Runtime.CompilerServices;
  5. namespace System.Linq
  6. {
  7. /// <summary>
  8. /// Interface for an awaiter of an asynchronous operation.
  9. /// </summary>
  10. public interface IAwaiter : ICriticalNotifyCompletion
  11. {
  12. /// <summary>
  13. /// Gets a Boolean value indicating whether the asynchronous operation has completed.
  14. /// </summary>
  15. bool IsCompleted { get; }
  16. /// <summary>
  17. /// Gets the result of the asynchronous operation.
  18. /// </summary>
  19. /// <remarks>
  20. /// This method may cause blocking if invoked prior to <see cref="IsCompleted"/> returning <c>true</c>.
  21. /// Completion of the asynchronous operation can be observed using <see cref="INotifyCompletion.OnCompleted(Action)"/>.
  22. /// </remarks>
  23. void GetResult();
  24. }
  25. }