Search Results for

    Show / Hide Table of Contents

    Interface IObserver<TValue, TResult>

    Provides a mechanism for receiving push-based notifications and returning a response.

    Namespace: System.Reactive
    Assembly: System.Reactive.Interfaces.dll
    Syntax
    public interface IObserver<in TValue, out TResult>
    Type Parameters
    Name Description
    TValue

    The type of the elements received by the observer. This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.

    TResult

    The type of the result returned from the observer's notification handlers. 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.

    Methods

    | Improve this Doc View Source

    OnCompleted()

    Notifies the observer of the end of the sequence.

    Declaration
    TResult OnCompleted()
    Returns
    Type Description
    TResult

    Result returned upon observation of the sequence completion.

    | Improve this Doc View Source

    OnError(Exception)

    Notifies the observer that an exception has occurred.

    Declaration
    TResult OnError(Exception exception)
    Parameters
    Type Name Description
    Exception exception

    The exception that occurred.

    Returns
    Type Description
    TResult

    Result returned upon observation of an error.

    | Improve this Doc View Source

    OnNext(TValue)

    Notifies the observer of a new element in the sequence.

    Declaration
    TResult OnNext(TValue value)
    Parameters
    Type Name Description
    TValue value

    The new element in the sequence.

    Returns
    Type Description
    TResult

    Result returned upon observation of a new element.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX