get

operator fun get(key: K): V

Answer the value associated with the specified key, computing the value from the user-supplied Function if the value is not already present in the cache.

Note that this method is not reentrant. The transformer must not reenter any public operation while computing a value for a specified key.

TODO: This needs to become getThen(), to prevent a race with retirement for a resource still actively in use (like a file handle that might get closed automatically by a retirement action).

Return

The value to which the specified key is mapped.

Parameters

key

The key whose associated value should be answered.

Throws

If an exception occurred as a result of an error in the execution of the user-supplied Function.