Пример #1
0
 public InMemoryPersistence(INetworkSimulator networkSimulator, Func <object, object> cloneFunc)
 {
     _chunks                 = new Chunk[1024 * 1024];
     _cloneFunc              = cloneFunc ?? (o => o);
     _networkSimulator       = networkSimulator ?? new NoNetworkLatencySimulator();
     _emptyInMemoryPartition = new InMemoryPartition("::empty", _networkSimulator, Clone);
     _partitions.TryAdd(_emptyInMemoryPartition.Id, _emptyInMemoryPartition);
 }
Пример #2
0
 public InMemoryPersistence(InMemoryPersistenceOptions options)
 {
     _chunks                 = new MemoryChunk[1024 * 1024];
     _options                = options;
     _cloneFunc              = _options.CloneFunc ?? (o => o);
     _networkSimulator       = _options.NetworkSimulator ?? new NoNetworkLatencySimulator();
     _emptyInMemoryPartition = new InMemoryPartition("::empty", _networkSimulator, Clone);
     _partitions.TryAdd(_emptyInMemoryPartition.Id, _emptyInMemoryPartition);
 }