Udostępnij za pośrednictwem


IEnvironmentVariableService.SubscribeAsync Method

Definition

Attaches an observer for updates to environment variables. The observer will always receive an initial message with the current environment variables.

public System.Threading.Tasks.Task<IDisposable> SubscribeAsync (IObserver<System.Collections.Generic.IReadOnlyDictionary<string,string>> observer, System.Threading.CancellationToken cancellationToken);
abstract member SubscribeAsync : IObserver<System.Collections.Generic.IReadOnlyDictionary<string, string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<IDisposable>
Public Function SubscribeAsync (observer As IObserver(Of IReadOnlyDictionary(Of String, String)), cancellationToken As CancellationToken) As Task(Of IDisposable)

Parameters

observer
IObserver<IReadOnlyDictionary<String,String>>

An observer of environment variable changes. The observer is called back with the currently defined environment variables, where the key is the name of the variable.

cancellationToken
CancellationToken

A cancellation token to cancel the in-progress invocation.

Returns

A value that may be disposed of to unregister observer from future notifications.

Applies to