)} ,System.Action{--0})} ,System.Action{--0},System.Action{System.Exception})} ,System.Action{--0},System.Action)} ,System.Action{--0},System.Action{System.Exception},System.Action)} ,System.IObserver{--0},System.Threading.CancellationToken)} ,System.Threading.CancellationToken)} ,System.Action{--0},System.Threading.CancellationToken)} ,System.Action{--0},System.Action{System.Exception},System.Threading.CancellationToken)} ,System.Action{--0},System.Action,System.Threading.CancellationToken)} ,System.Action{--0},System.Action{System.Exception},System.Action,System.Threading.CancellationToken)}
ObservableExtensions.Subscribe(IObservable) method¶
Defined in
Type: ObservableExtensions
Namespace: System
Assembly: System.Reactive.dll
Applies to
net8.0, net8.0-windows10.0.19041, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.0
Overloads¶
- 1.
public static IDisposable Subscribe<T>(this IObservable<T> source) - 2.
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext) - 3.
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError) - 4.
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted) - 5.
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted) - 6.
public static void Subscribe<T>(this IObservable<T> source, IObserver<T> observer, CancellationToken token) - 7.
public static void Subscribe<T>(this IObservable<T> source, CancellationToken token) - 8.
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, CancellationToken token) - 9.
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, CancellationToken token) - 10.
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted, CancellationToken token) - 11.
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted, CancellationToken token)
1. Overload¶
public static IDisposable Subscribe<T>(this IObservable<T> source)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
Returns: IDisposable
2. Overload¶
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
Returns: IDisposable
3. Overload¶
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onError | Action | -- |
Returns: IDisposable
4. Overload¶
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onCompleted | Action | -- |
Returns: IDisposable
5. Overload¶
public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onError | Action | -- |
onCompleted | Action | -- |
Returns: IDisposable
6. Overload¶
public static void Subscribe<T>(this IObservable<T> source, IObserver<T> observer, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
observer | IObserver | -- |
token | CancellationToken | -- |
7. Overload¶
public static void Subscribe<T>(this IObservable<T> source, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
token | CancellationToken | -- |
8. Overload¶
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
token | CancellationToken | -- |
9. Overload¶
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onError | Action | -- |
token | CancellationToken | -- |
10. Overload¶
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onCompleted | Action | -- |
token | CancellationToken | -- |
11. Overload¶
public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted, CancellationToken token)
Type parameters
| Name | Description |
|---|---|
T | -- |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | -- |
onNext | Action | -- |
onError | Action | -- |
onCompleted | Action | -- |
token | CancellationToken | -- |