Ejemplo n.º 1
0
		public void Store(string key, object value, DateTime expiry)
		{
			Store set = new Store(new Key(key, hasher), value, expiry);
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.Execute(set);
			}
			catch { }
		}
Ejemplo n.º 2
0
		public void BlockingDelete(string key)
		{
			BlockingDelete blockingDelete = new BlockingDelete(new Key(key, hasher));
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.Execute(blockingDelete);
			}
			catch { }
		}
Ejemplo n.º 3
0
		public uint? Increment(string key, long value)
		{
			Increment inc = new Increment(new Key(key, hasher), value);
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.Execute(inc);
				return inc.RetrievedValue;
			}
			catch
			{
				return null;
			}
		}
Ejemplo n.º 4
0
		public object Get(string key)
		{
			Get get = new Get(new Key(key, hasher));
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.Execute(get);
				return get.RetrievedObject;
			}
			catch
			{
				return null;
			}
		}
Ejemplo n.º 5
0
		public void Set(string key, string value, DateTime dateTime)
		{
			Set set = new Set(new Key(key, hasher), value, dateTime);
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.Execute(set);
			}
			catch { }
		}
Ejemplo n.º 6
0
		public object[] MultiGet(string[] keys)
		{
			Get[] gets = new Get[keys.Length];
			for (int i = 0; i < keys.Length; i++)
			{
				gets[i] = new Get(new Key(keys[i], hasher));
			}
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.ExecuteCommands(gets);
			}
			catch { }
			object[] returnedObjects = new object[keys.Length];
			for (int i = 0; i < gets.Length; i++)
			{
				returnedObjects[i] = gets[i].RetrievedObject;
			}
			return returnedObjects;
		}
Ejemplo n.º 7
0
		public void MultiSet(KeyValuePair<string, object>[] pairs, DateTime dateTime)
		{
			Set[] sets = new Set[pairs.Length];
			for (int i=0;i<sets.Length;i++)
			{
				KeyValuePair<string, object> pair = pairs[i];
				sets[i] = new Set(new Key(pair.Key, hasher), pair.Value, dateTime);
			}
			CommandExecuter ce = new CommandExecuter(instances);
			try
			{
				ce.ExecuteCommands(sets);
			}
			catch { }
		}