Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About TTL and ExpirationPolicy #92

Open
wp973 opened this issue Feb 10, 2025 · 2 comments
Open

About TTL and ExpirationPolicy #92

wp973 opened this issue Feb 10, 2025 · 2 comments

Comments

@wp973
Copy link

wp973 commented Feb 10, 2025

        ExpiringMap<String, String> build = ExpiringMap.builder()
                .expiration(10, TimeUnit.SECONDS)
                .maxSize(10)
                .expirationPolicy(ExpirationPolicy.ACCESSED)
                .build();

        build.put("foo", "bar");
        build.get("foo");

hi, @jhalterman, when "foo" is accessed before it expires, will the TTL of "foo" be refreshed?

@wp973
Copy link
Author

wp973 commented Feb 10, 2025

Is it possible to set the eviction policy for TTL and the eviction policy for maximum capacity separately?

like this:

// TTL
.expirationAfterAccess()
.expirationAfterWrite()

// maxSize
.maxSize()
.expirationPolicy(ExpirationPolicy.ACCESSED)

@wp973 wp973 changed the title About TTL About TTL and ExpirationPolicy Feb 10, 2025
@wp973
Copy link
Author

wp973 commented Feb 28, 2025

@jhalterman Could you help me look into this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant