Qbservable.Synchronize(IQbservable) method¶
Defined in
Type: Qbservable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IQbservable<TSource> Synchronize<TSource>(this IQbservable<TSource> source) - 2.
public static IQbservable<TSource> Synchronize<TSource>(this IQbservable<TSource> source, object gate)
1. Overload¶
public static IQbservable<TSource> Synchronize<TSource>(this IQbservable<TSource> source)
Summary: Synchronizes the observable sequence such that observer notifications cannot be delivered concurrently. This overload is useful to "fix" an observable sequence that exhibits concurrent callbacks on individual observers, which is invalid behavior for the query processor.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | Source sequence. |
Returns: IQbservable
Remarks
It's invalid behavior - according to the observer grammar - for a sequence to exhibit concurrent callbacks on a given observer.
This operator can be used to "fix" a source that doesn't conform to this rule.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
2. Overload¶
public static IQbservable<TSource> Synchronize<TSource>(this IQbservable<TSource> source, object gate)
Summary: Synchronizes the observable sequence such that observer notifications cannot be delivered concurrently, using the specified gate object. This overload is useful when writing n-ary query operators, in order to prevent concurrent callbacks from different sources by synchronizing on a common gate object.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | Source sequence. |
gate | object | Gate object to synchronize each observer call on. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or gate is null. |