RedisClientsManagerExtensions
Useful wrapper IRedisClientsManager to cut down the boiler plate of most IRedisClient access
Assembly: ServiceStack.Redis.dll
View Source
public static class RedisClientsManagerExtensions
Methods
GetClientAsync(IRedisClientsManager, CancellationToken)
View Source
public static ValueTask<IRedisClientAsync> GetClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns
ValueTask<ServiceStack.Redis.IRedisClientAsync>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Threading.CancellationToken | token |
GetReadOnlyClientAsync(IRedisClientsManager, CancellationToken)
View Source
public static ValueTask<IRedisClientAsync> GetReadOnlyClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns
ValueTask<ServiceStack.Redis.IRedisClientAsync>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Threading.CancellationToken | token |
GetCacheClientAsync(IRedisClientsManager, CancellationToken)
View Source
public static ValueTask<ICacheClientAsync> GetCacheClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns
ValueTask<ServiceStack.Caching.ICacheClientAsync>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Threading.CancellationToken | token |
GetReadOnlyCacheClientAsync(IRedisClientsManager, CancellationToken)
View Source
public static ValueTask<ICacheClientAsync> GetReadOnlyCacheClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns
ValueTask<ServiceStack.Caching.ICacheClientAsync>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Threading.CancellationToken | token |
ExecAsync(IRedisClientsManager, Func<IRedisClientAsync, ValueTask>)
View Source
public static async ValueTask ExecAsync(this IRedisClientsManager redisManager, Func<IRedisClientAsync, ValueTask> lambda)
Returns
ValueTask
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClientAsync,ValueTask> | lambda |
ExecAsync<T>(IRedisClientsManager, Func<IRedisClientAsync, ValueTask<T>>)
View Source
public static async ValueTask<T> ExecAsync<T>(this IRedisClientsManager redisManager, Func<IRedisClientAsync, ValueTask<T>> lambda)
Returns
ValueTask<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClientAsync,ValueTask<<T>>> | lambda |
Type Parameters
T
ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask>)
View Source
public static async ValueTask ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask> lambda)
Returns
ValueTask
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask> | lambda |
Type Parameters
T
ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask<T>>)
View Source
public static async ValueTask<T> ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask<T>> lambda)
Returns
ValueTask<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask<<T>>> | lambda |
Type Parameters
T
ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask<IList<T>>>)
View Source
public static async ValueTask<IList<T>> ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask<IList<T>>> lambda)
Returns
ValueTask<System.Collections.Generic.IList<<T>>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask<System.Collections.Generic.IList<<T>>>> | lambda |
Type Parameters
T
ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask<List<T>>>)
View Source
public static async ValueTask<List<T>> ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask<List<T>>> lambda)
Returns
ValueTask<System.Collections.Generic.List<<T>>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask<System.Collections.Generic.List<<T>>>> | lambda |
Type Parameters
T
CreatePubSubServer(IRedisClientsManager, String, Action<String, String>, Action<Exception>, Action, Action, Action)
Creates a PubSubServer that uses a background thread to listen and process for Redis Pub/Sub messages published to the specified channel. Use optional callbacks to listen for message, error and life-cycle events. Callbacks can be assigned later, then call Start() for PubSubServer to start listening for messages
View Source
public static IRedisPubSubServer CreatePubSubServer(this IRedisClientsManager redisManager, string channel, Action<string, string> onMessage = null, Action<Exception> onError = null, Action onInit = null, Action onStart = null, Action onStop = null)
Returns
ServiceStack.Redis.IRedisPubSubServer
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.String | channel |
System.Action<System.String,System.String> | onMessage |
System.Action<System.Exception> | onError |
System.Action | onInit |
System.Action | onStart |
System.Action | onStop |
Exec(IRedisClientsManager, Action<IRedisClient>)
View Source
public static void Exec(this IRedisClientsManager redisManager, Action<IRedisClient> lambda)
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Action<ServiceStack.Redis.IRedisClient> | lambda |
Exec(IRedisClientsManager, Func<IRedisClient, String>)
View Source
public static string Exec(this IRedisClientsManager redisManager, Func<IRedisClient, string> lambda)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClient,System.String> | lambda |
Exec(IRedisClientsManager, Func<IRedisClient, Int64>)
View Source
public static long Exec(this IRedisClientsManager redisManager, Func<IRedisClient, long> lambda)
Returns
System.Int64
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClient,System.Int64> | lambda |
Exec(IRedisClientsManager, Func<IRedisClient, Int32>)
View Source
public static int Exec(this IRedisClientsManager redisManager, Func<IRedisClient, int> lambda)
Returns
System.Int32
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClient,System.Int32> | lambda |
Exec(IRedisClientsManager, Func<IRedisClient, Double>)
View Source
public static double Exec(this IRedisClientsManager redisManager, Func<IRedisClient, double> lambda)
Returns
System.Double
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClient,System.Double> | lambda |
Exec(IRedisClientsManager, Func<IRedisClient, Boolean>)
View Source
public static bool Exec(this IRedisClientsManager redisManager, Func<IRedisClient, bool> lambda)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.IRedisClient,System.Boolean> | lambda |
ExecTrans(IRedisClientsManager, Action<IRedisTransaction>)
View Source
public static void ExecTrans(this IRedisClientsManager redisManager, Action<IRedisTransaction> lambda)
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Action<ServiceStack.Redis.IRedisTransaction> | lambda |
ExecAs<T>(IRedisClientsManager, Action<IRedisTypedClient<T>>)
View Source
public static void ExecAs<T>(this IRedisClientsManager redisManager, Action<IRedisTypedClient<T>> lambda)
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Action<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>> | lambda |
Type Parameters
T
ExecAs<T>(IRedisClientsManager, Func<IRedisTypedClient<T>, T>)
View Source
public static T ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, T> lambda)
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>,<T>> | lambda |
Type Parameters
T
ExecAs<T>(IRedisClientsManager, Func<IRedisTypedClient<T>, IList<T>>)
View Source
public static IList<T> ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, IList<T>> lambda)
Returns
System.Collections.Generic.IList<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>,System.Collections.Generic.IList<<T>>> | lambda |
Type Parameters
T
ExecAs<T>(IRedisClientsManager, Func<IRedisTypedClient<T>, List<T>>)
View Source
public static List<T> ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, List<T>> lambda)
Returns
System.Collections.Generic.List<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Redis.IRedisClientsManager | redisManager |
System.Func<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>,System.Collections.Generic.List<<T>>> | lambda |
Type Parameters
T