Method TryPurgeAsync
- Namespace
- NATS.Client.KeyValueStore
- Assembly
- NATS.Client.KeyValueStore.dll
TryPurgeAsync(string, NatsKVDeleteOpts?, CancellationToken)
Tries to purge an entry from the bucket
ValueTask<NatsResult> TryPurgeAsync(string key, NatsKVDeleteOpts? opts = null, CancellationToken cancellationToken = default)Parameters
- keystring
- Key of the entry 
- optsNatsKVDeleteOpts
- Delete options 
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the API call. 
Returns
- ValueTask<NatsResult>
- A NatsResult object representing success or an error. 
Remarks
Use this method to avoid exceptions
TryPurgeAsync(string, TimeSpan, NatsKVDeleteOpts?, CancellationToken)
Tries to purge an entry from the bucket
ValueTask<NatsResult> TryPurgeAsync(string key, TimeSpan ttl, NatsKVDeleteOpts? opts = null, CancellationToken cancellationToken = default)Parameters
- keystring
- Key of the entry 
- ttlTimeSpan
- Time to live for the purge marker (requires the LimitMarkerTTL to be set to true). For a key that should never expire, use the MaxValue constant. This feature is only available on NATS server v2.11 and later. 
- optsNatsKVDeleteOpts
- Delete options 
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the API call. 
Returns
- ValueTask<NatsResult>
- A NatsResult object representing success or an error. 
Remarks
Use this method to avoid exceptions