Skip to content

)} ,System.Object)}

Synchronization.Synchronize(IObservable) method

Defined in

Type: Synchronization Namespace: System.Reactive.Concurrency Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<TSource> Synchronize<TSource>(IObservable<TSource> source)
  • 2. public static IObservable<TSource> Synchronize<TSource>(IObservable<TSource> source, object gate)

1. Overload

public static IObservable<TSource> Synchronize<TSource>(IObservable<TSource> source)

Summary: Wraps the source sequence in order to ensure observer callbacks are properly serialized.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.

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

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

2. Overload

public static IObservable<TSource> Synchronize<TSource>(IObservable<TSource> source, object gate)

Summary: Wraps the source sequence in order to ensure observer callbacks are synchronized using the specified gate object.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence.
gateobjectGate object to synchronize each observer call on.

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

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or gate is null.