public SimpleMemcachedClientFailoverTests() : base(TestName) { // note: we're intentionally adding a dead server new ClusterBuilder(TestName) .Endpoints("localhost:11300") .SocketOpts(connectionTimeout: TimeSpan.FromMilliseconds(100)) .Use .ReconnectPolicy(() => new PeriodicReconnectPolicy { Interval = TimeSpan.FromHours(1) }) .Register(); config = new ClientConfigurationBuilder().Cluster(TestName).Create(); client = new SimpleMemcachedClient(config); }
public static bool Replace(this ISimpleMemcachedClient self, string key, object value, Expiration expiration) { return(self.Store(StoreMode.Replace, key, value, expiration)); }
public static ulong Increment(this ISimpleMemcachedClient self, string key, Expiration expiration, ulong delta = Protocol.MUTATE_DEFAULT_DELTA, ulong defaultValue = Protocol.MUTATE_DEFAULT_VALUE) { return(self.Mutate(MutationMode.Increment, key, expiration, delta, defaultValue)); }
public static bool Set(this ISimpleMemcachedClient self, string key, object value) { return(self.Store(StoreMode.Set, key, value, Expiration.Never)); }
public static bool FlushAll(this ISimpleMemcachedClient self) { return(self.FlushAllAsync().RunAndUnwrap()); }
public static Task <object> GetAsync(this ISimpleMemcachedClient self, string key) { return(self.GetAsync <object>(key)); }
public static T Get <T>(this ISimpleMemcachedClient self, string key) { return(self.GetAsync <T>(key).RunAndUnwrap()); }
public static Task <ulong> MutateAsync(this ISimpleMemcachedClient self, MutationMode mode, string key, Expiration expiration) { return(self.MutateAsync(mode, key, expiration, Protocol.MUTATE_DEFAULT_DELTA, Protocol.MUTATE_DEFAULT_VALUE)); }
public static ulong Mutate(this ISimpleMemcachedClient self, MutationMode mode, string key, Expiration expiration, ulong delta = Protocol.MUTATE_DEFAULT_DELTA, ulong defaultValue = Protocol.MUTATE_DEFAULT_VALUE) { return(self.MutateAsync(mode, key, expiration, delta, defaultValue).RunAndUnwrap()); }
public static bool Prepend(this ISimpleMemcachedClient self, string key, byte[] data) { return(self.Concate(ConcatenationMode.Prepend, key, new ArraySegment <byte>(data))); }
public static Task <bool> PrependAsync(this ISimpleMemcachedClient self, string key, ArraySegment <byte> data) { return(self.ConcateAsync(ConcatenationMode.Prepend, key, data)); }
public static Task <T> GetAndTouchAsync <T>(this ISimpleMemcachedClient self, string key) { return(self.GetAndTouchAsync <T>(key, Expiration.Never)); }
public static T GetAndTouch <T>(this ISimpleMemcachedClient self, string key, Expiration expiration) { return(self.GetAndTouchAsync <T>(key, expiration).RunAndUnwrap()); }
public static Task <ServerStats> StatsAsync(this ISimpleMemcachedClient self) { return(self.StatsAsync(null)); }
public static object Get(this ISimpleMemcachedClient self, string key) { return(self.Get <object>(key)); }
public static bool Concate(this ISimpleMemcachedClient self, ConcatenationMode mode, string key, ArraySegment<byte> data) { return self.ConcateAsync(mode, key, data).RunAndUnwrap(); }
public static IDictionary <string, object> Get(this ISimpleMemcachedClient self, IEnumerable <string> keys) { return(self.GetAsync(keys).RunAndUnwrap()); }
public static Task<bool> ConcateAsync(this ISimpleMemcachedClient self, ConcatenationMode mode, string key, byte[] data) { return self.ConcateAsync(mode, key, new ArraySegment<byte>(data)); }
public SimpleMemcachedClientTests(PrivateServerFixture data) : base("SimpleMemcachedClientTests") { client = new SimpleMemcachedClient(data.ClientConfig); }
public static bool Touch(this ISimpleMemcachedClient self, string key) { return(self.Touch(key, Expiration.Never)); }
public static bool Store(this ISimpleMemcachedClient self, StoreMode mode, string key, object value, Expiration expiration) { return(self.StoreAsync(mode, key, value, expiration).RunAndUnwrap()); }
public static bool Touch(this ISimpleMemcachedClient self, string key, Expiration expiration) { return(self.TouchAsync(key, expiration).RunAndUnwrap()); }
public static Task <bool> SetAsync(this ISimpleMemcachedClient self, string key, object value, Expiration expiration) { return(self.StoreAsync(StoreMode.Set, key, value, expiration)); }
public static Task <bool> TouchAsync(this ISimpleMemcachedClient self, string key) { return(self.TouchAsync(key, Expiration.Never)); }
public SimpleMemcachedClientTests(MemcachedClientConfigFixture fixture) : base("SimpleMemcachedClientTests") { client = new SimpleMemcachedClient(fixture.Config); }
public static bool Append(this ISimpleMemcachedClient self, string key, ArraySegment <byte> data) { return(self.Concate(ConcatenationMode.Append, key, data)); }
public static Task <ulong> IncrementAsync(this ISimpleMemcachedClient self, string key, ulong delta = Protocol.MUTATE_DEFAULT_DELTA, ulong defaultValue = Protocol.MUTATE_DEFAULT_VALUE) { return(self.MutateAsync(MutationMode.Increment, key, Expiration.Never, delta, defaultValue)); }
public static Task <bool> AppendAsync(this ISimpleMemcachedClient self, string key, byte[] data) { return(self.ConcateAsync(ConcatenationMode.Append, key, new ArraySegment <byte>(data))); }
public static Task <bool> ReplaceAsync(this ISimpleMemcachedClient self, string key, object value) { return(self.StoreAsync(StoreMode.Replace, key, value, Expiration.Never)); }
public static ServerStats Stats(this ISimpleMemcachedClient self, string key = null) { return(self.StatsAsync(key).RunAndUnwrap()); }