Skip to main content

CacheClientWithPrefixAsync

Decorates the ICacheClient (and its siblings) prefixing every key with the given prefix

Useful for multi-tenant environments

Assembly: ServiceStack.dll
View Source
Declaration
public class CacheClientWithPrefixAsync : ICacheClientAsync, IRemoveByPatternAsync

Properties

Prefix

View Source
Declaration
public string Prefix { get; }

Methods

RemoveAsync(String, CancellationToken)

View Source
Declaration
public async Task<bool> RemoveAsync(string key, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
System.Threading.CancellationTokentoken

GetAsync<T>(String, CancellationToken)

View Source
Declaration
public async Task<T> GetAsync<T>(string key, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
System.Stringkey
System.Threading.CancellationTokentoken
Type Parameters
  • T

IncrementAsync(String, UInt32, CancellationToken)

View Source
Declaration
public async Task<long> IncrementAsync(string key, uint amount, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Int64>

Parameters
TypeName
System.Stringkey
System.UInt32amount
System.Threading.CancellationTokentoken

DecrementAsync(String, UInt32, CancellationToken)

View Source
Declaration
public async Task<long> DecrementAsync(string key, uint amount, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Int64>

Parameters
TypeName
System.Stringkey
System.UInt32amount
System.Threading.CancellationTokentoken

AddAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.Threading.CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.Threading.CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.Threading.CancellationTokentoken
Type Parameters
  • T

SetAllAsync<T>(IDictionary<String, T>, CancellationToken)

View Source
Declaration
public async Task SetAllAsync<T>(IDictionary<string, T> values, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Collections.Generic.IDictionary<System.String,<T>>values
System.Threading.CancellationTokentoken
Type Parameters
  • T

GetAllAsync<T>(IEnumerable<String>, CancellationToken)

View Source
Declaration
public async Task<IDictionary<string, T>> GetAllAsync<T>(IEnumerable<string> keys, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<System.String,<T>>>

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.String>keys
System.Threading.CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
System.Threading.CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
System.Threading.CancellationTokentoken
Type Parameters
  • T

AddAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.TimeSpanexpiresIn
System.Threading.CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
System.Threading.CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
System.Threading.CancellationTokentoken
Type Parameters
  • T

AddAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
System.DateTimeexpiresAt
System.Threading.CancellationTokentoken
Type Parameters
  • T

RemoveAllAsync(IEnumerable<String>, CancellationToken)

View Source
Declaration
public async Task RemoveAllAsync(IEnumerable<string> keys, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Collections.Generic.IEnumerable<System.String>keys
System.Threading.CancellationTokentoken

FlushAllAsync(CancellationToken)

View Source
Declaration
public async Task FlushAllAsync(CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokentoken

RemoveByPatternAsync(String, CancellationToken)

View Source
Declaration
public async Task RemoveByPatternAsync(string pattern, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Stringpattern
System.Threading.CancellationTokentoken

RemoveByRegexAsync(String, CancellationToken)

View Source
Declaration
public async Task RemoveByRegexAsync(string regex, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Stringregex
System.Threading.CancellationTokentoken

GetKeysByPatternAsync(String, CancellationToken)

View Source
Declaration
public async IAsyncEnumerable<string> GetKeysByPatternAsync(string pattern, CancellationToken token = default(CancellationToken))
Returns

IAsyncEnumerable<System.String>

Parameters
TypeName
System.Stringpattern
System.Threading.CancellationTokentoken

DisposeAsync()

View Source
Declaration
public ValueTask DisposeAsync()
Returns

ValueTask

RemoveExpiredEntriesAsync(CancellationToken)

View Source
Declaration
public async Task RemoveExpiredEntriesAsync(CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokentoken

GetTimeToLiveAsync(String, CancellationToken)

View Source
Declaration
public async Task<TimeSpan?> GetTimeToLiveAsync(string key, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Nullable<System.TimeSpan>>

Parameters
TypeName
System.Stringkey
System.Threading.CancellationTokentoken

Implements