Table of Contents

Method PurgeStreamAsync

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll

PurgeStreamAsync(string, StreamPurgeRequest, CancellationToken)

Purges all of the (or filtered) data in a stream, leaves the stream.

public ValueTask<StreamPurgeResponse> PurgeStreamAsync(string stream, StreamPurgeRequest request, CancellationToken cancellationToken = default)

Parameters

stream string

Stream name to be purged.

request StreamPurgeRequest

Purge request.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<StreamPurgeResponse>

Purge response

Exceptions

NatsJSException

There was an issue retrieving the response.

NatsJSApiException

Server responded with an error.

ArgumentException

The stream name is invalid.

ArgumentNullException

The stream name is null.