-
Notifications
You must be signed in to change notification settings - Fork 216
Conversation
|
||
namespace Microsoft.AspNet.MemoryCache | ||
{ | ||
public interface IMemoryCache : IEnumerable<KeyValuePair<string, object>>, IDisposable |
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.
[AssemblyNeutral]
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.
I'd recommend not having the cache itself be enumerable.
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.
Suggestion: have an API that can get a cache dependency object for a given (key, value) entry. This would allow creating custom dependency chains where entries in a given memory cache can be dependent on entries in an arbitrary other memory cache.
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.
+1 - what is the concept name of a cache dependency object? ICacheDependency? IMemoryCacheToken? IDependencyToken?
To be honest the object name dependency always seemed like an odd fit for an expiration trigger.
Updated. I've added some usage samples that may be a better way to discuss scenarios. |
Updated. |
public enum EvictionReason | ||
{ | ||
None, | ||
// Manually |
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 turn these into doc comments. We'll need them eventually anyway.
Squashed. Last call for comments. |
{ | ||
public void Main() | ||
{ | ||
IMemoryCache cache = null; |
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.
Just wondering where do you instantiate this cache variable?
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.
There isn't an implementation available yet. This sample is just for demonstration purposes, it won't actually run.
{ | ||
// TODO: Granularity? | ||
/// <summary> | ||
/// Specifies how items are prioritized for presurvation during a memory pressure triggered cleanup. |
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.
Late to the party, but typo in presurvation
.
@davidfowl @GrabYourPitchforks @lodejard @DamianEdwards @yishaigalatzer