Logically acquires a resource.
Logically acquires a resource. If this is the first time acquire
is called, this may
call acquire
on the underlying producer. Otherwise, it will simply re-use the already
acquired resource and internally increment a use counter.
the resource key
the resource value, possibly an uncompleted future if the value was not cached
Disposes the underlying producer (and thus invalidates this consumer as well).
Disposes the underlying producer (and thus invalidates this consumer as well).
Logically releases a resources.
Logically releases a resources. This internally decrements a use counter. If the counter
reaches zero, it actually calls release
on the underlying producer.
the resource key
true
if the resource was actually released from the producer.
Reports the cache usage of the underlying producer.
Reports the cache usage of the underlying producer.
A
Consumer
simplifies resource management by maintaining a use count for each cached value. Furthermore, it combines a producer with a production function.the key type
the value type