public void Connect(RedisConnectionStringBuilder connectionString) { _client = new RedisClientAsync(((IPEndPoint)connectionString.EndPoint).Address.ToString(), ((IPEndPoint)connectionString.EndPoint).Port, 10000); _syncClient = new ctstone.Redis.RedisClient(((IPEndPoint)connectionString.EndPoint).Address.ToString(), ((IPEndPoint)connectionString.EndPoint).Port, 10000); }
public void Connect(RedisConnectionStringBuilder connectionString) { _client = new RedisClientAsync(((IPEndPoint) connectionString.EndPoint).Address.ToString(), ((IPEndPoint) connectionString.EndPoint).Port, 10000); _syncClient = new ctstone.Redis.RedisClient(((IPEndPoint) connectionString.EndPoint).Address.ToString(), ((IPEndPoint) connectionString.EndPoint).Port, 10000); }
async static Task Test2Async() { var RedisClient = new RedisClientAsync(); await RedisClient.Connect("localhost", 6379); Console.WriteLine((await RedisClient.Command("set", "hello-csharp", "999")).ToJson()); Console.WriteLine((await RedisClient.Command("get", "hello-csharp")).ToJson()); }
public async Task _CommandTestAsync() { var RedisClient = new RedisClientAsync(); /* * await RedisClient.Connect("localhost", 6379); * Console.WriteLine((await RedisClient.Command("set", "hello-csharp", "1")).ToJson()); * Console.WriteLine((await RedisClient.Command("get", "hello-csharp")).ToJson()); */ }
public void Initialize() { Host = ConfigurationManager.AppSettings["host"]; Port = Int32.Parse(ConfigurationManager.AppSettings["port"]); Password = ConfigurationManager.AppSettings["password"]; _redis = new Lazy <RedisClient>(() => { RedisClient redis = new RedisClient(Host, Port, 0); redis.Auth(Password); return(redis); }); _async = new Lazy <RedisClientAsync>(() => { RedisClientAsync async = new RedisClientAsync(Host, Port, 0); async.Auth(Password).Wait(); return(async); }); }
public void Initialize() { Host = ConfigurationManager.AppSettings["host"]; Port = Int32.Parse(ConfigurationManager.AppSettings["port"]); Password = ConfigurationManager.AppSettings["password"]; _redis = new Lazy<RedisClient>(() => { RedisClient redis = new RedisClient(Host, Port, 0); redis.Auth(Password); return redis; }); _async = new Lazy<RedisClientAsync>(() => { RedisClientAsync async = new RedisClientAsync(Host, Port, 0); async.Auth(Password).Wait(); return async; }); }
public RedisTestKeys(RedisClientAsync async, params string[] keys) { _async = async; _keys = keys; _async.Del(keys).Wait(); }