Skip to content

)} ,System.Object)}

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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence.

Returns: IQbservable -- The source sequence whose outgoing calls to observers are synchronized.

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

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence.
gateobjectGate object to synchronize each observer call on.

Returns: IQbservable -- The source sequence whose outgoing calls to observers are synchronized on the given gate object.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or gate is null.