Esempio n. 1
0
        /// <summary>
        /// Create a new MemcachedAccess instance.
        /// </summary>
        /// <param name="memcachedConfig">The Memcached configuration.</param>
        public MemcachedAccess(MemcachedConfig memcachedConfig)
        {
            var loggerFactory      = new LoggerFactory();
            var splittedConnstring = memcachedConfig.ConnectionString.Split(":");
            var options            = new MemcachedClientOptions()
            {
                Protocol = MemcachedProtocol.Text,
                Servers  = new List <Server> {
                    new Server
                    {
                        Address = splittedConnstring[0].Trim(),
                        Port    = int.Parse(splittedConnstring[1].Trim())
                    }
                }
            };
            var config = new MemcachedClientConfiguration(loggerFactory, options);

            MemcachedClient = new MemcachedClient <ConnectorEntity>(loggerFactory, config);
        }
 /// <summary>
 /// Create a new MemcachedOperations instance.
 /// </summary>
 public MemcachedOperations(MemcachedConfig memcachedConfig)
 {
     _memcachedWrapper = new MemcachedWrapper(memcachedConfig);
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new MemcachedWrapper instance.
 /// </summary>
 /// <param name="memcachedConfig">The Memcached connector config.</param>
 public MemcachedWrapper(MemcachedConfig memcachedConfig)
 {
     _memcachedAccess = new MemcachedAccess(memcachedConfig);
 }