Creates a new consumer from a given producer and production function.
Creates a new consumer from a given producer and production function.
the key type
the value type
the cache producing instance
a function which will create the value for a given key whenever the resource is acquired and no valid cached value is found.
A
Consumer
simplifies resource management by maintaining a use count for each cached value. Furthermore, it combines a producer with a production function.