-
Notifications
You must be signed in to change notification settings - Fork 217
Conversation
if (AbsoluteExpirationRelativeToNow != null) | ||
{ | ||
throw new InvalidOperationException( | ||
$"Cannot set both the properties '{nameof(AbsoluteExpirationRelativeToNow)}' " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should get from resources?
⌚ So far so good, but I only reviewed the memory cache components. Distributed Cache and Redis haven't completed API review yet, so you might as well leave them out of the PR until we get memory cache finished. Let me know when you're ready to work on entry links. |
return new object(); | ||
}); | ||
result = cache.Set( | ||
key, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have an example of a set call that doesn't chain the options into a single argument?
var options = new CacheEntryOptions()
.RegisterPostEvictionCallback((echoKey, value, reason, substate) =>
Console.WriteLine(echoKey + ": '" + value + "' was evicted due to " + reason), state: null);
result = cache.Set(key, new object(), options);
But with better formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
3474a18
to
96cc9d1
Compare
|
||
Task<bool> TryGetValueAsync(string key, out byte[] value); | ||
|
||
void Set(string key, byte[] value, CacheEntryOptions options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Distributed cache will not use the same options type as memory cache, many of the options are different. Give it its own options type like before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this becomes DistributedCacheEntryOptions as per yesterday's review.
ffdae36
to
a583c86
Compare
Updated. /cc: @Tratcher |
59a8ef3
to
bbe53db
Compare
bbe53db
to
becd1c2
Compare
@@ -30,5 +44,14 @@ public void SetAbsoluteExpiration(DateTimeOffset absoluteExpiration) | |||
AbsoluteExpiration = absoluteExpiration; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IEntryLink.SetAbsoluteExpiration probably needs a new name like AddAbsoluteExpiration
that indicates it's not strictly an overwrite.
3613b52
to
c2f614d
Compare
pending the redis test run. |
49e810b
to
e07fe60
Compare
e07fe60
to
d630272
Compare
@Tratcher
Please note: