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

Support cache expiration #2

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Support cache expiration #2

merged 2 commits into from
Mar 5, 2019

Conversation

yysskk
Copy link
Owner

@yysskk yysskk commented Mar 4, 2019

Example codes

 /// The expiration date is `.never`.
memoryCache.set(dog, for: .dog, expiration: .never)

 /// The expiration date is `.seconds("""10s""")`.
memoryCache.set(dog, for: .dog, expiration: .seconds(10))

 /// The expiration date is `.date("""TOMORROW""")`.
memoryCache.set(dog, for: .dog, expiration: .date(Date().addingTimeInterval(60 * 60 * 24)))

 /// Remove the cache of the specified key if it expired.
memoryCache.removeIfExpired(for: .dog)

@yysskk yysskk added the WIP Work in progress label Mar 4, 2019
@yysskk yysskk removed the WIP Work in progress label Mar 5, 2019
@yysskk yysskk merged commit bb4030c into master Mar 5, 2019
@yysskk yysskk deleted the add-expiration branch March 5, 2019 06:02
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

Successfully merging this pull request may close these issues.

None yet

1 participant