Method PurgeAsync
PurgeAsync(StreamPurgeRequest, CancellationToken)
Purge data from this stream. Leaves the stream.
public ValueTask<StreamPurgeResponse> PurgeAsync(StreamPurgeRequest request, CancellationToken cancellationToken = default)
Parameters
request
StreamPurgeRequestPurge request.
cancellationToken
CancellationTokenA CancellationToken used to cancel the API call.
Returns
- ValueTask<StreamPurgeResponse>
Whether delete was successful or not.
Remarks
After deletion this object can't be used anymore.
Exceptions
- NatsJSException
There is an error retrieving the response or this consumer object isn't valid anymore because it was deleted earlier.
- NatsJSApiException
Server responded with an error.