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(); }
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)); }
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)); }
internal Group(string groupName, IGetter getter, IPeerPicker peers) : this(groupName, getter, peers, new MemoryCache()) { }