Freigeben über


ServiceBrokerClient.Invalidated Event

Definition

Occurs when previously acquired proxies have gone stale.

public:
 event Microsoft::ServiceHub::Framework::ServiceBrokerClient::ClientProxiesInvalidatedEventHandler ^ Invalidated;
public event Microsoft.ServiceHub.Framework.ServiceBrokerClient.ClientProxiesInvalidatedEventHandler? Invalidated;
member this.Invalidated : Microsoft.ServiceHub.Framework.ServiceBrokerClient.ClientProxiesInvalidatedEventHandler 
Public Event Invalidated As ServiceBrokerClient.ClientProxiesInvalidatedEventHandler 

Event Type

Remarks

Handlers should release any outstanding rentals at their earliest convenience and use GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken) to get new proxies. Exceptions thrown or faulted tasks returned by the handler are ignored.

Handlers return a Task to they can carry out asynchronous operations such as acquiring and initializing new services without fear that another invocation of their handler will happen concurrently. Any further invalidation event will await for handlers of the prior event to complete before raising the next one. The CancellationToken provided to the earlier invocation signals that a follow-up event is waiting to be raised to reset the services again. Note however that even if the event handler has not yet completed, all calls to GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken) will always return a proxy to the most current service available.

Applies to