示例#1
0
 internal Group(string groupName, IGetter getter, IPeerPicker peers, ICache localCache)
 {
     this._groupName  = groupName;
     this._getter     = getter;
     this._peers      = peers;
     this._localCache = localCache;
     this.Stats       = new NullGroupStat();
     this.Logger      = new NullLogger();
     this._localCache.ItemOverCapacity += ItemWasOverCapacity;
     this.CacheEntryValidator           = new NullCacheEntryValidator();
 }
示例#2
0
        public static Group NewGroup(string name, IGetter getter, IPeerPicker peers)
        {
            Argument.NotNull(name, "name");
            Argument.NotNull(getter, "getter");
            Argument.NotNull(peers, "peers");
            var groupKey = new GroupKey {
                GroupName = name, Endpoint = peers.Self
            };
            var group = new Group(name, getter, peers);

            return(GROUPS.GetOrAdd(groupKey, group));
        }
示例#3
0
        public static Group NewGroup(string groupName, Func <string, Stream, ICacheControl, CancellationToken, Task> getterFunc, IPeerPicker peers)
        {
            Argument.NotNull(getterFunc, "getterFunc");
            var getter = new GetterFunc(getterFunc);

            return(NewGroup(groupName, getter, peers));
        }
示例#4
0
 internal Group(string groupName, IGetter getter, IPeerPicker peers)
     : this(groupName, getter, peers, new MemoryCache())
 {
 }