public IndexWriter(Stream stream, bool disposeStream, IKeySerializer <TKey> keySerializer) { this.underlyingStream = stream; this.disposeStream = disposeStream; this.keySerializer = keySerializer; this.buffer = new MemoryStream(32768); this.writer = new BinaryWriter(this.buffer, Encoding.UTF8); }
public V1IndexReader(Stream stream, bool disposeStream, IKeySerializer <TKey> keySerializer) { this.underlyingStream = stream; this.disposeStream = disposeStream; this.keySerializer = keySerializer; this.buffer = new MemoryStream((int)this.underlyingStream.Length); this.reader = new BinaryReader(this.buffer); }
public SimpleCache(IDistributedCache cache, IServiceProvider serviceProvider, SimpleCacheOptions <TKey, TValue> options) { _cache = cache; _serviceProvider = serviceProvider; _keySpace = options.KeySpace ?? typeof(TValue).FullName + ":"; _keySerializer = options.KeySerializer ?? new DefaultKeySerializer(); _valueSerializer = options.ValueSerializer ?? new JsonValueSerializer(); _defaultEntryOptions = options.DefaultEntryOptions ?? new DistributedCacheEntryOptions(); _valueFactory = options.ValueFactory; _fallbackToFactoryOnException = options.FallbackToFactoryOnException; }
public KeyService( KeyRackOptions options, IKeyRepository repository, IKeySerializer serializer, ITimeKeeper timeKeeper, ILogger <KeyService> logger) { _options = options; _repository = repository; _serializer = serializer; _timeKeeper = timeKeeper; _logger = logger; }
public MemcacheClientConfiguration() { Authenticator = null; PoolSize = 2; DeadTimeout = TimeSpan.FromSeconds(15); SocketTimeout = TimeSpan.FromMilliseconds(200); QueueTimeout = Timeout.Infinite; QueueLength = 0; TransportConnectTimerPeriod = TimeSpan.FromMilliseconds(1000); Replicas = 0; const int sixtyFourKb = 1 << 16; TransportReceiveBufferSize = sixtyFourKb; TransportSendBufferSize = sixtyFourKb; KeySerializer = new UTF8KeySerializer(); }
public MemcacheClientConfiguration() { Authenticator = null; PoolSize = 2; DeadTimeout = TimeSpan.FromSeconds(15); SocketTimeout = TimeSpan.FromMilliseconds(200); QueueTimeout = Timeout.Infinite; QueueLength = 0; TransportConnectTimerPeriod = TimeSpan.FromMilliseconds(1000); Replicas = 0; // The point is having something just bigger than the MTU. I could use 10KB to handle jumbo frames also. const int tenKB = 10 * 1024; PinnedBufferSize = tenKB; const int sixtyFourKB = 1 << 16; TransportReceiveBufferSize = sixtyFourKB; TransportSendBufferSize = sixtyFourKB; KeySerializer = new UTF8KeySerializer(); }
public V3IndexReader(Stream stream, bool disposeStream, IKeySerializer <TKey> keySerializer) : base(stream, disposeStream, keySerializer) { }
public BinarySerializer(IKeySerializer <TKey> keySerializer) { this.keySerializer = keySerializer; }
public static SimpleCacheOptions <TKey, TValue> WithKeySerializer <TKey, TValue>(this SimpleCacheOptions <TKey, TValue> options, IKeySerializer keySerializer) where TValue : class { options.KeySerializer = keySerializer; return(options); }
public KeyServiceConcurrencyTests() { _options = CreateTestOptions(); _timeKeeper = new TimeKeeper(_options); _serializer = new DefaultKeySerializer(); }
public MemoryCacheBasedQueryCache(IKeySerializer <TKey> keySerializer) { _keySerializer = keySerializer; }