Table of Contents

Method RemoveEndpointAsync

Namespace
NATS.Client.Services
Assembly
NATS.Client.Services.dll

RemoveEndpointAsync(string, CancellationToken)

Removes an endpoint by name, draining and disposing it.

public ValueTask RemoveEndpointAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

Name of the endpoint to remove.

cancellationToken CancellationToken

A CancellationToken used to bound the drain operation's PING/PONG fence

Returns

ValueTask

A ValueTask representing the asynchronous operation.

Remarks

The endpoint stops receiving new messages, then any messages it has already received are handled before it is disposed. Other endpoints on this service are unaffected.

Endpoints added through a NatsSvcServer.Group are removed by their endpoint name, without the group prefix.

Exceptions

NatsSvcException

There is no endpoint with that name.