Method RemoveEndpointAsync
RemoveEndpointAsync(string, CancellationToken)
Removes an endpoint by name, draining and disposing it.
public ValueTask RemoveEndpointAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringName of the endpoint to remove.
cancellationTokenCancellationTokenA CancellationToken used to bound the drain operation's PING/PONG fence
Returns
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.