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

Add TrySet method for providers #64

Closed
catcherwong opened this issue Jan 4, 2019 · 1 comment
Closed

Add TrySet method for providers #64

catcherwong opened this issue Jan 4, 2019 · 1 comment
Assignees
Labels
feature feature

Comments

@catcherwong
Copy link
Member

catcherwong commented Jan 4, 2019

Description

We need TrySet/TrySetAsync methods for providers.

If we want to add a cache with an existed key, we should not handle it and return false.

If the cache is not an existed key, we should add it to the cached value and return true.

Steps to Reproduce

None

Related code

bool TrySet<T>(string cacheKey, T cacheValue, TimeSpan expiration);

Task<bool> TrySetAsync<T>(string cacheKey, T cacheValue, TimeSpan expiration);

Specifications

None

@catcherwong catcherwong added the feature feature label Jan 4, 2019
@catcherwong catcherwong self-assigned this Jan 4, 2019
catcherwong added a commit that referenced this issue Jan 5, 2019
@catcherwong
Copy link
Member Author

Version 0.4.2 contains this caching API.

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

No branches or pull requests

1 participant