)} ,System.TimeSpan)} ,System.TimeSpan,System.Reactive.Concurrency.IScheduler)} ,System.Int32)} ,System.Int32,System.TimeSpan)} ,System.Int32,System.TimeSpan,System.Reactive.Concurrency.IScheduler)}
Observable.RefCount(IConnectableObservable) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source) - 2.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, TimeSpan disconnectDelay) - 3.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, TimeSpan disconnectDelay, IScheduler scheduler) - 4.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers) - 5.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers, TimeSpan disconnectDelay) - 6.
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers, TimeSpan disconnectDelay, IScheduler scheduler)
1. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
2. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, TimeSpan disconnectDelay)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
disconnectDelay | TimeSpan | The time span that should be waited before possibly unsubscribing from the connectable observable. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
3. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, TimeSpan disconnectDelay, IScheduler scheduler)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
disconnectDelay | TimeSpan | The time span that should be waited before possibly unsubscribing from the connectable observable. |
scheduler | [IScheduler](# | The scheduler to use for delayed unsubscription. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
4. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
minObservers | int | The minimum number of observers required to subscribe before establishing the connection to the source. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | minObservers is non-positive. |
5. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers, TimeSpan disconnectDelay)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
minObservers | int | The minimum number of observers required to subscribe before establishing the connection to the source. |
disconnectDelay | TimeSpan | The time span that should be waited before possibly unsubscribing from the connectable observable. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | minObservers is non-positive. |
6. Overload¶
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source, int minObservers, TimeSpan disconnectDelay, IScheduler scheduler)
Summary: Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IConnectableObservable | Connectable observable sequence. |
minObservers | int | The minimum number of observers required to subscribe before establishing the connection to the source. |
disconnectDelay | TimeSpan | The time span that should be waited before possibly unsubscribing from the connectable observable. |
scheduler | [IScheduler](# | The scheduler to use for delayed unsubscription. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | minObservers is non-positive. |