DVDistributedCacheAdapter constructor
DVDistributedCacheAdapter({
- required Map<
String, DVCacheAdapter> nodes, - int replicas = 1,
Implementation
DVDistributedCacheAdapter({
required Map<String, DVCacheAdapter> nodes,
this.replicas = 1,
}) : nodes = Map<String, DVCacheAdapter>.unmodifiable(nodes) {
if (nodes.isEmpty) {
// A cache with nowhere to put anything would answer every read with a
// miss and look like a cache that is merely cold, forever.
throw ArgumentError.value(nodes, 'nodes', 'needs at least one node');
}
if (replicas < 1) {
throw ArgumentError.value(replicas, 'replicas', 'must be at least one');
}
}