Share via


IUnifiedSettingsService.SubscribeAsync Method

Definition

Subscribe to changes in settings values.

public System.Threading.Tasks.ValueTask<IDisposable> SubscribeAsync (IObserver<Microsoft.VisualStudio.RpcContracts.UnifiedSettings.SettingsUpdate> observer, System.Collections.Generic.IReadOnlyCollection<string> monikerPatterns, Microsoft.VisualStudio.RpcContracts.UnifiedSettings.ReadOptions options, System.Threading.CancellationToken cancellationToken);
abstract member SubscribeAsync : IObserver<Microsoft.VisualStudio.RpcContracts.UnifiedSettings.SettingsUpdate> * System.Collections.Generic.IReadOnlyCollection<string> * Microsoft.VisualStudio.RpcContracts.UnifiedSettings.ReadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<IDisposable>
Public Function SubscribeAsync (observer As IObserver(Of SettingsUpdate), monikerPatterns As IReadOnlyCollection(Of String), options As ReadOptions, cancellationToken As CancellationToken) As ValueTask(Of IDisposable)

Parameters

observer
IObserver<SettingsUpdate>

An observer for update events. Each update event contains ReadResults for all known settings at the time of the update that match the monikerPatterns, not just the changed values.

monikerPatterns
IReadOnlyCollection<String>

Patterns of monikers to watch. Use '' as a suffix to match all the monikers with a prefix. Example: 'environment.general.'.

options
ReadOptions

The options to use when reading each value.

cancellationToken
CancellationToken

A cancellation token.

Returns

An object that can be disposed when the subscription is no longer required.

Applies to