acquire method
Implementation
Future<V> acquire(K key, DspReg disposers) {
final entry = _entries.putIfAbsent(key, () {
final disposers = DspImpl();
final value = _factory(key, disposers);
return _RefCountEntry(value, disposers);
});
entry.count++;
disposers.add(() {
entry.count--;
if (entry.count == 0) {
_entries.remove(key);
return entry.disposers.dispose();
}
});
return entry.value;
}