1
0

IObserver.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #if NO_RXINTERFACES
  5. namespace System
  6. {
  7. /// <summary>
  8. /// Supports push-style iteration over an observable sequence.
  9. /// </summary>
  10. #if !NO_VARIANCE
  11. public interface IObserver<in T>
  12. #else
  13. public interface IObserver<T>
  14. #endif
  15. {
  16. /// <summary>
  17. /// Notifies the observer of a new element in the sequence.
  18. /// </summary>
  19. /// <param name="value">Next element in the sequence.</param>
  20. void OnNext(T value);
  21. /// <summary>
  22. /// Notifies the observer that an exception has occurred.
  23. /// </summary>
  24. /// <param name="error">The error that has occurred.</param>
  25. void OnError(Exception error);
  26. /// <summary>
  27. /// Notifies the observer of the end of the sequence.
  28. /// </summary>
  29. void OnCompleted();
  30. }
  31. }
  32. #elif !WINDOWSPHONE7 // TypeForwardedTo is not present on Windows Phone 7 so we can't really target
  33. [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IObserver<>))]
  34. #endif