Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/netcore2
Browse files Browse the repository at this point in the history
# Conflicts:
#	LazyCache/LazyCache.nuspec
  • Loading branch information
alastairtree committed May 13, 2018
2 parents 5bba5c5 + 9862ffa commit 6941cbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Func<ComplexObjects> complexObjectFactory = () => methodThatTakesTimeOrResources

// Get our ComplexObjects from the cache, or build them in the factory func
// and cache the results for next time under the given key
ComplexObject cachedResults = cache.GetOrAdd("uniqueKey", complexObjectFactory);
ComplexObjects cachedResults = cache.GetOrAdd("uniqueKey", complexObjectFactory);
```

As you can see the magic happens in the `GetOrAdd()` method which gives the consumer an atomic and tidy way to add caching to your code. It leverages a factory delegate `Func` and generics to make it easy to add cached method calls to your app.
Expand All @@ -59,7 +59,7 @@ For .net framework 4.0 use LazyCache 0.6
## Features ##

- Simple API with familiar sliding or absolute expiration
- Guaranteed single evaluation of you factory delegate whose results you want to cache
- Guaranteed single evaluation of your factory delegate whose results you want to cache
- Strongly typed generics based API. No need to cast your cached objects every time you retieve them
- Thread safe, concurrency ready
- Async compatible - lazy single evaluation of async delegates using `GetOrAddAsync()`
Expand Down

0 comments on commit 6941cbc

Please sign in to comment.