GithubHelp home page GithubHelp logo

xzcai / dclsystem Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fanliang11/dclsystem

0.0 1.0 0.0 29.12 MB

分布式缓存,实现一致性哈希算法,集成 couchbase,redis,webcache,membercache

C# 100.00%

dclsystem's Introduction

DCLSystem

分布式缓存,实现一致性哈希算法,集成 couchbase,redis,webcache,membercache

 var o = CacheContainer.GetInstances<ICacheProvider>("ddlCache.Redis");

      o.Add("dddd","gggg",60);

      var b = o.Get<string>("dddd");

couchbase:

var o = CacheContainer.GetInstances<ICacheProvider>("ddlCache.Couchbase");

      o.Add("dddd","gggg",60);

      var b = o.Get<string>("dddd");
      
      value内容实现了GZIP压缩

MemberCache:

var o = CacheContainer.GetInstances<ICacheProvider>("ddlCache.MemberCache");

      o.Add("dddd","gggg",60);

      var b = o.Get<string>("dddd");

WebCache:

var o = CacheContainer.GetInstances<WebCacheProvider>(CacheTargetType.WebCache.ToString());

      o.Add("dddd","gggg",60);

      var b = o.Get<string>("dddd");
      
 var o = CacheContainer.GetInstances<ICacheProvider>("WebCache");

      o.Add("dddd","gggg",60);

      var b = o.Get<string>("dddd");

支持异步添加,删除,获取

 var o = CacheContainer.GetInstances<ICacheProvider>("ddlCache.Redis");
      o.AddAsync("dddd", "gggg", 4444);
      o.GetAsync<string>("dddd").Result;
       o.RemoveAsync("dddd");
       
       DCLSystem拦截器集成

web.config

SocketPool,ObjectPool 默认minSize: 1 maxSize:50,并发数提高,请配置maxSize

<bindings>

  <binding id="ddlCache" class="DCLSystem.Core.Caching.RedisCache.RedisContext,DCLSystem.Core.Caching">
    <property name="appRuleFile" ref="rule"/>
    <property name="dataContextPool" value="ddls_sample">
      <map name="Redis">
        <property  value="127.0.0.1:6379::4"/>
      </map>
      <map name="WebCache"></map>
       <map name="CouchBase">
         <property  value="fanly:[email protected]:6379::pools"/>
      </map>
    </property>
    <property name="defaultExpireTime" value="120"/>
   <property name="connectTimeout" value="120"/>
   <property name="minSize" value="1"/>
  <property name="maxSize" value="200"/>
  </binding>
     <binding id="testCache" class="DCLSystem.Core.Caching.RedisCache.RedisContext,DCLSystem.Core.Caching">
    <property name="appRuleFile" ref="rule"/>
    <property name="dataContextPool" value="ddls_sample">
      <map name="Redis">
        <property  value="127.0.0.1:6379::4"/>
      </map>
       <map name="CouchBase">
        <property  value="fanly:[email protected]:6379"/>
      </map>
    </property>
    <property name="defaultExpireTime" value="120"/>
   <property name="connectTimeout" value="120"/>
   <property name="minSize" value="1"/>
  <property name="maxSize" value="50"/>
  </binding>
</bindings>

dclsystem's People

Contributors

fanliang11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.