Skip to main content

RedisClientsManagerExtensions

Useful wrapper IRedisClientsManager to cut down the boiler plate of most IRedisClient access

Assembly: ServiceStack.Redis.dll
View Source
Declaration
public static class RedisClientsManagerExtensions

Methods

GetClientAsync(IRedisClientsManager, CancellationToken)

View Source
Declaration
public static ValueTask<IRedisClientAsync> GetClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns

ValueTask<ServiceStack.Redis.IRedisClientAsync>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Threading.CancellationTokentoken

GetReadOnlyClientAsync(IRedisClientsManager, CancellationToken)

View Source
Declaration
public static ValueTask<IRedisClientAsync> GetReadOnlyClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns

ValueTask<ServiceStack.Redis.IRedisClientAsync>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Threading.CancellationTokentoken

GetCacheClientAsync(IRedisClientsManager, CancellationToken)

View Source
Declaration
public static ValueTask<ICacheClientAsync> GetCacheClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns

ValueTask<ServiceStack.Caching.ICacheClientAsync>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Threading.CancellationTokentoken

GetReadOnlyCacheClientAsync(IRedisClientsManager, CancellationToken)

View Source
Declaration
public static ValueTask<ICacheClientAsync> GetReadOnlyCacheClientAsync(this IRedisClientsManager redisManager, CancellationToken token = default(CancellationToken))
Returns

ValueTask<ServiceStack.Caching.ICacheClientAsync>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Threading.CancellationTokentoken

ExecAsync(IRedisClientsManager, Func<IRedisClientAsync, ValueTask>)

View Source
Declaration
public static async ValueTask ExecAsync(this IRedisClientsManager redisManager, Func<IRedisClientAsync, ValueTask> lambda)
Returns

ValueTask

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClientAsync,ValueTask>lambda

ExecAsync<T>(IRedisClientsManager, Func<IRedisClientAsync, ValueTask<T>>)

View Source
Declaration
public static async ValueTask<T> ExecAsync<T>(this IRedisClientsManager redisManager, Func<IRedisClientAsync, ValueTask<T>> lambda)
Returns

ValueTask<<T>>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClientAsync,ValueTask<<T>>>lambda
Type Parameters
  • T

ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask>)

View Source
Declaration
public static async ValueTask ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask> lambda)
Returns

ValueTask

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask>lambda
Type Parameters
  • T

ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask<T>>)

View Source
Declaration
public static async ValueTask<T> ExecAsAsync<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClientAsync<T>, ValueTask<T>> lambda)
Returns

ValueTask<<T>>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.Generic.IRedisTypedClientAsync<<T>>,ValueTask<<T>>>lambda
Type Parameters
  • T

ExecAsAsync<T>(IRedisClientsManager, Func<IRedisTypedClientAsync<T>, ValueTask<IList<T>>>)

View Source
Declaration
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
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
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
Declaration
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
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
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
Declaration
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
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Stringchannel
System.Action<System.String,System.String>onMessage
System.Action<System.Exception>onError
System.ActiononInit
System.ActiononStart
System.ActiononStop

Exec(IRedisClientsManager, Action<IRedisClient>)

View Source
Declaration
public static void Exec(this IRedisClientsManager redisManager, Action<IRedisClient> lambda)
Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Action<ServiceStack.Redis.IRedisClient>lambda

Exec(IRedisClientsManager, Func<IRedisClient, String>)

View Source
Declaration
public static string Exec(this IRedisClientsManager redisManager, Func<IRedisClient, string> lambda)
Returns

System.String

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClient,System.String>lambda

Exec(IRedisClientsManager, Func<IRedisClient, Int64>)

View Source
Declaration
public static long Exec(this IRedisClientsManager redisManager, Func<IRedisClient, long> lambda)
Returns

System.Int64

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClient,System.Int64>lambda

Exec(IRedisClientsManager, Func<IRedisClient, Int32>)

View Source
Declaration
public static int Exec(this IRedisClientsManager redisManager, Func<IRedisClient, int> lambda)
Returns

System.Int32

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClient,System.Int32>lambda

Exec(IRedisClientsManager, Func<IRedisClient, Double>)

View Source
Declaration
public static double Exec(this IRedisClientsManager redisManager, Func<IRedisClient, double> lambda)
Returns

System.Double

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClient,System.Double>lambda

Exec(IRedisClientsManager, Func<IRedisClient, Boolean>)

View Source
Declaration
public static bool Exec(this IRedisClientsManager redisManager, Func<IRedisClient, bool> lambda)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.IRedisClient,System.Boolean>lambda

ExecTrans(IRedisClientsManager, Action<IRedisTransaction>)

View Source
Declaration
public static void ExecTrans(this IRedisClientsManager redisManager, Action<IRedisTransaction> lambda)
Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Action<ServiceStack.Redis.IRedisTransaction>lambda

ExecAs<T>(IRedisClientsManager, Action<IRedisTypedClient<T>>)

View Source
Declaration
public static void ExecAs<T>(this IRedisClientsManager redisManager, Action<IRedisTypedClient<T>> lambda)
Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Action<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>>lambda
Type Parameters
  • T

ExecAs<T>(IRedisClientsManager, Func<IRedisTypedClient<T>, T>)

View Source
Declaration
public static T ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, T> lambda)
Returns

<T>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>,<T>>lambda
Type Parameters
  • T

ExecAs<T>(IRedisClientsManager, Func<IRedisTypedClient<T>, IList<T>>)

View Source
Declaration
public static IList<T> ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, IList<T>> lambda)
Returns

System.Collections.Generic.IList<<T>>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
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
Declaration
public static List<T> ExecAs<T>(this IRedisClientsManager redisManager, Func<IRedisTypedClient<T>, List<T>> lambda)
Returns

System.Collections.Generic.List<<T>>

Parameters
TypeName
ServiceStack.Redis.IRedisClientsManagerredisManager
System.Func<ServiceStack.Redis.Generic.IRedisTypedClient<<T>>,System.Collections.Generic.List<<T>>>lambda
Type Parameters
  • T