CacheClientWithPrefixAsync
Decorates the ICacheClient (and its siblings) prefixing every key with the given prefix
Useful for multi-tenant environments
Assembly: ServiceStack.dll
View Source
public class CacheClientWithPrefixAsync : ICacheClientAsync, IRemoveByPatternAsync
Properties
Prefix
View Source
public string Prefix { get; }
Methods
RemoveAsync(String, CancellationToken)
View Source
public async Task<bool> RemoveAsync(string key, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
System.Threading.CancellationToken | token |
GetAsync<T>(String, CancellationToken)
View Source
public async Task<T> GetAsync<T>(string key, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<T>>
Parameters
Type | Name |
---|---|
System.String | key |
System.Threading.CancellationToken | token |
Type Parameters
T
IncrementAsync(String, UInt32, CancellationToken)
View Source
public async Task<long> IncrementAsync(string key, uint amount, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Int64>
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
System.Threading.CancellationToken | token |
DecrementAsync(String, UInt32, CancellationToken)
View Source
public async Task<long> DecrementAsync(string key, uint amount, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Int64>
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
System.Threading.CancellationToken | token |
AddAsync<T>(String, T, CancellationToken)
View Source
public async Task<bool> AddAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.Threading.CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, CancellationToken)
View Source
public async Task<bool> SetAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.Threading.CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, CancellationToken)
View Source
public async Task<bool> ReplaceAsync<T>(string key, T value, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.Threading.CancellationToken | token |
Type Parameters
T
SetAllAsync<T>(IDictionary<String, T>, CancellationToken)
View Source
public async Task SetAllAsync<T>(IDictionary<string, T> values, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Collections.Generic.IDictionary<System.String,<T>> | values |
System.Threading.CancellationToken | token |
Type Parameters
T
GetAllAsync<T>(IEnumerable<String>, CancellationToken)
View Source
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
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.String> | keys |
System.Threading.CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
public async Task<bool> ReplaceAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
System.Threading.CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
public async Task<bool> SetAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
System.Threading.CancellationToken | token |
Type Parameters
T
AddAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
public async Task<bool> AddAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.TimeSpan | expiresIn |
System.Threading.CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, DateTime, CancellationToken)
View Source
public async Task<bool> ReplaceAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
System.Threading.CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, DateTime, CancellationToken)
View Source
public async Task<bool> SetAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
System.Threading.CancellationToken | token |
Type Parameters
T
AddAsync<T>(String, T, DateTime, CancellationToken)
View Source
public async Task<bool> AddAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
System.DateTime | expiresAt |
System.Threading.CancellationToken | token |
Type Parameters
T
RemoveAllAsync(IEnumerable<String>, CancellationToken)
View Source
public async Task RemoveAllAsync(IEnumerable<string> keys, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.String> | keys |
System.Threading.CancellationToken | token |
FlushAllAsync(CancellationToken)
View Source
public async Task FlushAllAsync(CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Threading.CancellationToken | token |
RemoveByPatternAsync(String, CancellationToken)
View Source
public async Task RemoveByPatternAsync(string pattern, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | pattern |
System.Threading.CancellationToken | token |
RemoveByRegexAsync(String, CancellationToken)
View Source
public async Task RemoveByRegexAsync(string regex, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | regex |
System.Threading.CancellationToken | token |
GetKeysByPatternAsync(String, CancellationToken)
View Source
public async IAsyncEnumerable<string> GetKeysByPatternAsync(string pattern, CancellationToken token = default(CancellationToken))
Returns
IAsyncEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String | pattern |
System.Threading.CancellationToken | token |
DisposeAsync()
View Source
public ValueTask DisposeAsync()
Returns
ValueTask
RemoveExpiredEntriesAsync(CancellationToken)
View Source
public async Task RemoveExpiredEntriesAsync(CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Threading.CancellationToken | token |
GetTimeToLiveAsync(String, CancellationToken)
View Source
public async Task<TimeSpan?> GetTimeToLiveAsync(string key, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Nullable<System.TimeSpan>>
Parameters
Type | Name |
---|---|
System.String | key |
System.Threading.CancellationToken | token |