Class Memoized<T,E extends Exception>

java.lang.Object
com.yahoo.yolean.concurrent.Memoized<T,E>
All Implemented Interfaces:
AutoCloseable, Supplier<T>

public class Memoized<T,E extends Exception> extends Object implements Supplier<T>, AutoCloseable
Wraps a lazily initialised resource which needs to be shut down. The wrapped supplier may not return null, and should be retryable on failure. If it throws, it will be retried if get() is retried. A supplier that fails to clean up partial state on failure may cause a resource leak.
Author:
jonmv