IConnectableObservable.cs 1.3 KB

1234567891011121314151617181920212223242526
  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. namespace System.Reactive.Subjects
  5. {
  6. /// <summary>
  7. /// Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence.
  8. /// </summary>
  9. /// <typeparam name="T">
  10. /// The type of the elements in the sequence.
  11. /// This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
  12. /// </typeparam>
  13. #if !NO_VARIANCE
  14. public interface IConnectableObservable<out T> : IObservable<T>
  15. #else
  16. public interface IConnectableObservable<T> : IObservable<T>
  17. #endif
  18. {
  19. /// <summary>
  20. /// Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established.
  21. /// </summary>
  22. /// <returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns>
  23. IDisposable Connect();
  24. }
  25. }