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 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);
        }
예제 #3
0
 public static bool Replace(this ISimpleMemcachedClient self, string key, object value, Expiration expiration)
 {
     return(self.Store(StoreMode.Replace, key, value, expiration));
 }
예제 #4
0
 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));
 }
예제 #5
0
 public static bool Set(this ISimpleMemcachedClient self, string key, object value)
 {
     return(self.Store(StoreMode.Set, key, value, Expiration.Never));
 }
예제 #6
0
 public static bool FlushAll(this ISimpleMemcachedClient self)
 {
     return(self.FlushAllAsync().RunAndUnwrap());
 }
예제 #7
0
 public static Task <object> GetAsync(this ISimpleMemcachedClient self, string key)
 {
     return(self.GetAsync <object>(key));
 }
예제 #8
0
 public static T Get <T>(this ISimpleMemcachedClient self, string key)
 {
     return(self.GetAsync <T>(key).RunAndUnwrap());
 }
예제 #9
0
 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));
 }
예제 #10
0
 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());
 }
예제 #11
0
 public static bool Prepend(this ISimpleMemcachedClient self, string key, byte[] data)
 {
     return(self.Concate(ConcatenationMode.Prepend, key, new ArraySegment <byte>(data)));
 }
예제 #12
0
 public static Task <bool> PrependAsync(this ISimpleMemcachedClient self, string key, ArraySegment <byte> data)
 {
     return(self.ConcateAsync(ConcatenationMode.Prepend, key, data));
 }
예제 #13
0
 public static Task <T> GetAndTouchAsync <T>(this ISimpleMemcachedClient self, string key)
 {
     return(self.GetAndTouchAsync <T>(key, Expiration.Never));
 }
예제 #14
0
 public static T GetAndTouch <T>(this ISimpleMemcachedClient self, string key, Expiration expiration)
 {
     return(self.GetAndTouchAsync <T>(key, expiration).RunAndUnwrap());
 }
예제 #15
0
 public static Task <ServerStats> StatsAsync(this ISimpleMemcachedClient self)
 {
     return(self.StatsAsync(null));
 }
예제 #16
0
 public static object Get(this ISimpleMemcachedClient self, string key)
 {
     return(self.Get <object>(key));
 }
예제 #17
0
		public static bool Concate(this ISimpleMemcachedClient self, ConcatenationMode mode, string key, ArraySegment<byte> data)
		{
			return self.ConcateAsync(mode, key, data).RunAndUnwrap();
		}
예제 #18
0
 public static IDictionary <string, object> Get(this ISimpleMemcachedClient self, IEnumerable <string> keys)
 {
     return(self.GetAsync(keys).RunAndUnwrap());
 }
예제 #19
0
		public static Task<bool> ConcateAsync(this ISimpleMemcachedClient self, ConcatenationMode mode, string key, byte[] data)
		{
			return self.ConcateAsync(mode, key, new ArraySegment<byte>(data));
		}
예제 #20
0
 public SimpleMemcachedClientTests(PrivateServerFixture data)
     : base("SimpleMemcachedClientTests")
 {
     client = new SimpleMemcachedClient(data.ClientConfig);
 }
예제 #21
0
 public static bool Touch(this ISimpleMemcachedClient self, string key)
 {
     return(self.Touch(key, Expiration.Never));
 }
예제 #22
0
 public static bool Store(this ISimpleMemcachedClient self, StoreMode mode, string key, object value, Expiration expiration)
 {
     return(self.StoreAsync(mode, key, value, expiration).RunAndUnwrap());
 }
예제 #23
0
 public static bool Touch(this ISimpleMemcachedClient self, string key, Expiration expiration)
 {
     return(self.TouchAsync(key, expiration).RunAndUnwrap());
 }
예제 #24
0
 public static Task <bool> SetAsync(this ISimpleMemcachedClient self, string key, object value, Expiration expiration)
 {
     return(self.StoreAsync(StoreMode.Set, key, value, expiration));
 }
예제 #25
0
 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);
 }
예제 #27
0
 public static bool Append(this ISimpleMemcachedClient self, string key, ArraySegment <byte> data)
 {
     return(self.Concate(ConcatenationMode.Append, key, data));
 }
예제 #28
0
 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));
 }
예제 #29
0
 public static Task <bool> AppendAsync(this ISimpleMemcachedClient self, string key, byte[] data)
 {
     return(self.ConcateAsync(ConcatenationMode.Append, key, new ArraySegment <byte>(data)));
 }
예제 #30
0
 public static Task <bool> ReplaceAsync(this ISimpleMemcachedClient self, string key, object value)
 {
     return(self.StoreAsync(StoreMode.Replace, key, value, Expiration.Never));
 }
예제 #31
0
 public static ServerStats Stats(this ISimpleMemcachedClient self, string key = null)
 {
     return(self.StatsAsync(key).RunAndUnwrap());
 }