FabricClient.ServiceManagementClient.RegisterServiceNotificationFilterAsync Method

Definition

Overloads

RegisterServiceNotificationFilterAsync(ServiceNotificationFilterDescription, TimeSpan, CancellationToken)

Registers a ServiceNotificationFilterDescription. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

RegisterServiceNotificationFilterAsync(ServiceNotificationFilterDescription)

Registers a ServiceNotificationFilterDescription.

RegisterServiceNotificationFilterAsync(ServiceNotificationFilterDescription, TimeSpan, CancellationToken)

Registers a ServiceNotificationFilterDescription. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

public System.Threading.Tasks.Task<long> RegisterServiceNotificationFilterAsync (System.Fabric.Description.ServiceNotificationFilterDescription description, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.RegisterServiceNotificationFilterAsync : System.Fabric.Description.ServiceNotificationFilterDescription * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int64>
Public Function RegisterServiceNotificationFilterAsync (description As ServiceNotificationFilterDescription, timeout As TimeSpan, cancellationToken As CancellationToken) As Task(Of Long)

Parameters

description
ServiceNotificationFilterDescription

The description that determines which service endpoint change events should be delivered to this client through the ServiceNotificationFilterMatched event.

timeout
System.TimeSpan

The maximum time allowed for processing the request before System.TimeoutException is thrown.

cancellationToken
System.Threading.CancellationToken

Reserved for future use.

Returns

System.Threading.Tasks.Task<System.Int64>

A System.Threading.Tasks.Task representing the async operation. The task result is an ID corresponding to the registered ServiceNotificationFilterDescription that can be used to unregister the same filter through UnregisterServiceNotificationFilterAsync(Int64).

Exceptions

System.ArgumentNullException

If description is null.

Remarks

There is a cache of service endpoints in the client that gets updated by notifications and this same cache is used to satisfy complaint based resolution requests (see ResolveServicePartitionAsync(Uri, ResolvedServicePartition)). Applications that both register for notifications and use complaint based resolution on the same client instance typically only need to pass null for the ResolvedServicePartition argument during resolution. This will always return the endpoints in the client cache updated by the latest notification. The notification mechanism itself will keep the client cache updated when service endpoints change, there is no need to convert from a ServiceNotification to a ResolvedServicePartition for the purposes of refreshing the client cache.

Applies to

RegisterServiceNotificationFilterAsync(ServiceNotificationFilterDescription)

public System.Threading.Tasks.Task<long> RegisterServiceNotificationFilterAsync (System.Fabric.Description.ServiceNotificationFilterDescription description);
member this.RegisterServiceNotificationFilterAsync : System.Fabric.Description.ServiceNotificationFilterDescription -> System.Threading.Tasks.Task<int64>
Public Function RegisterServiceNotificationFilterAsync (description As ServiceNotificationFilterDescription) As Task(Of Long)

Parameters

description
ServiceNotificationFilterDescription

The description that determines which service endpoint change events should be delivered to this client through the ServiceNotificationFilterMatched event.

Returns

System.Threading.Tasks.Task<System.Int64>

A System.Threading.Tasks.Task representing the async operation. The task result is an ID corresponding to the registered ServiceNotificationFilterDescription that can be used to unregister the same filter through UnregisterServiceNotificationFilterAsync(Int64).

Exceptions

System.ArgumentNullException

If description is null.

Remarks

The default timeout is one minute for which the system will allow this operation to continue before returning System.TimeoutException.

There is a cache of service endpoints in the client that gets updated by notifications and this same cache is used to satisfy complaint based resolution requests (see ResolveServicePartitionAsync(Uri, ResolvedServicePartition)). Applications that both register for notifications and use complaint based resolution on the same client instance typically only need to pass null for the ResolvedServicePartition argument during resolution. This will always return the endpoints in the client cache updated by the latest notification. The notification mechanism itself will keep the client cache updated when service endpoints change, there is no need to convert from a ServiceNotification to a ResolvedServicePartition for the purposes of refreshing the client cache.

Applies to