get(). * * @param callable $function * @return Supplier */ public static function memoize($function) { return new MemoizingSupplier($function); } /** * Returns a supplier which caches the callback result and removes the cached value after specified time. * Subsequent calls to get() return the cached value if expiration time has not passed. * Time is passed in seconds. * * @param callable $function * @param int $expireTime * @return Supplier */ public static function memoizeWithExpiration($function, $expireTime = 3600) { return new ExpiringMemoizingSupplier($function, $expireTime); } }