Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
426adff
Add HybridCacheFactoryContext and context-aware GetOrCreateAsync over…
svick Apr 22, 2026
7f06ec1
Fix XML docs on HybridCacheEntryOptions properties
svick Apr 22, 2026
c3e3ec1
Update flag docs: enumerate write-side and read-side flags explicitly
svick Apr 23, 2026
570f73b
Rename HybridCacheFactoryContext to HybridCacheEntryContext; add Curr…
svick May 12, 2026
5f929e6
Initial implementation of the approved API
svick May 14, 2026
1bebad4
Small improvements
svick Jun 4, 2026
64223d8
Added compatibility suppression for changing init setters to regular …
svick Jun 5, 2026
69ce3e2
Make sure externally called internal methods are preserved
svick Jun 5, 2026
801c9f0
Comments updates
svick Jun 5, 2026
29dac38
Added tests for the default implementation
svick Jun 10, 2026
c47eed5
Small helper method to centralize comment
svick Jun 10, 2026
0092bbd
Rework factory options API to HybridCacheEntryContext
svick Jul 9, 2026
919a158
Remove ineffective ILLink.Descriptors.LibraryBuild.xml
svick Jul 9, 2026
8bda51a
Make HybridCacheEntryContext options-seeding constructor the public one
svick Jul 9, 2026
a448113
Add contract tests for ReadOnlySpan<char> and interpolated-string key…
svick Jul 9, 2026
3ceb09e
Clarify HybridCacheEntryContext initialization guarantee in remarks
svick Jul 9, 2026
99ed585
Use the field keyword in HybridCacheEntryContext
svick Jul 9, 2026
3daf0ad
Use 'Gets or sets' for HybridCacheEntryOptions property docs
svick Jul 9, 2026
e9245a6
Defer context allocation and avoid redundant options materialization …
svick Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<Project Path="../Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj" />
<Project Path="src/Microsoft.Extensions.Caching.Abstractions.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/Microsoft.Extensions.Caching.Abstractions.Tests.csproj" />
</Folder>
<Folder Name="/tools/" />
<Folder Name="/tools/gen/">
<Project Path="../../tools/illink/src/ILLink.CodeFix/ILLink.CodeFixProvider.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,21 @@ public interface IHybridCacheSerializerFactory
{
bool TryCreateSerializer<T>([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out IHybridCacheSerializer<T>? serializer);
}
public sealed class HybridCacheEntryContext
{
public HybridCacheEntryContext(HybridCacheEntryOptions? options) { }
public System.TimeSpan? Expiration { get { throw null; } set { } }
Comment thread
svick marked this conversation as resolved.
public System.TimeSpan? LocalCacheExpiration { get { throw null; } set { } }
public HybridCacheEntryFlags? Flags { get { throw null; } set { } }
public long? LocalSize { get { throw null; } set { } }
public int Revision { get { throw null; } }
Comment thread
svick marked this conversation as resolved.
}
Comment thread
svick marked this conversation as resolved.
public sealed class HybridCacheEntryOptions
{
public System.TimeSpan? Expiration { get; init; }
public System.TimeSpan? LocalCacheExpiration { get; init; }
public HybridCacheEntryFlags? Flags { get; init; }
public long? LocalSize { get; init; }
}
Comment thread
svick marked this conversation as resolved.
Comment thread
svick marked this conversation as resolved.
Comment thread
svick marked this conversation as resolved.
[System.Flags]
public enum HybridCacheEntryFlags
Expand All @@ -203,6 +213,16 @@ public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<T>(string key, Syste
HybridCacheEntryOptions? options = null, System.Collections.Generic.IEnumerable<string>? tags = null, System.Threading.CancellationToken cancellationToken = default)
=> throw null;

public virtual System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state,
System.Func<TState, HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
HybridCacheEntryOptions? options = null, System.Collections.Generic.IEnumerable<string>? tags = null, System.Threading.CancellationToken cancellationToken = default)
=> throw null;

public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<T>(string key,
System.Func<HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
HybridCacheEntryOptions? options = null, System.Collections.Generic.IEnumerable<string>? tags = null, System.Threading.CancellationToken cancellationToken = default)
=> throw null;

public abstract System.Threading.Tasks.ValueTask SetAsync<T>(string key, T value, HybridCacheEntryOptions? options = null, System.Collections.Generic.IEnumerable<string>? tags = null, System.Threading.CancellationToken cancellationToken = default);

public abstract System.Threading.Tasks.ValueTask RemoveAsync(string key, System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,31 @@ public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<TState, T>(
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null,
System.Collections.Generic.IEnumerable<string>? tags = null,
System.Threading.CancellationToken cancellationToken = default) => throw null;
public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<T>(
System.ReadOnlySpan<char> key,
System.Func<Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null,
System.Collections.Generic.IEnumerable<string>? tags = null,
System.Threading.CancellationToken cancellationToken = default) => throw null;
public virtual System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<TState, T>(
System.ReadOnlySpan<char> key,
TState state,
System.Func<TState, Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null,
System.Collections.Generic.IEnumerable<string>? tags = null,
System.Threading.CancellationToken cancellationToken = default) => throw null;
public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<T>(
ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler key,
System.Func<Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null,
System.Collections.Generic.IEnumerable<string>? tags = null,
System.Threading.CancellationToken cancellationToken = default) => throw null;
public System.Threading.Tasks.ValueTask<T> GetOrCreateAsync<TState, T>(
ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler key,
TState state,
System.Func<TState, Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>> factory,
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null,
System.Collections.Generic.IEnumerable<string>? tags = null,
System.Threading.CancellationToken cancellationToken = default) => throw null;
}
}
Loading
Loading