-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Caching: migrate HybridCache api surface from asp.net into runtime #103103
Conversation
Note regarding the
|
1 similar comment
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-extensions-caching |
With all the nifty |
To offer non-string keys, we'd need the API to take a |
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
test fail seemingly unrelated:
will retry, and if that doesn't help: try a main merge and rebase |
4aeb6fc
to
30533c3
Compare
(after rebase) shakes fist at CI:
|
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.
Could you please include tests.
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
…brid/HybridCache.cs Co-authored-by: David Cantú <[email protected]>
…brid/HybridCache.cs Co-authored-by: David Cantú <[email protected]>
…brid/HybridCache.cs Co-authored-by: David Cantú <[email protected]>
...s/Microsoft.Extensions.Caching.Abstractions/ref/Microsoft.Extensions.Caching.Abstractions.cs
Outdated
Show resolved
Hide resolved
...s/Microsoft.Extensions.Caching.Abstractions/ref/Microsoft.Extensions.Caching.Abstractions.cs
Show resolved
Hide resolved
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param> | ||
/// <returns>The data, either from cache or the underlying data service.</returns> | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Delegate differences make this unambiguous")] | ||
public abstract ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> factory, |
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 the order of TState / T be changed so that in all overloads the T is first?
{ | ||
// for the simple usage scenario (no TState), pack the original callback as the "state", and use a wrapper function that just unrolls and invokes from the state | ||
public static readonly Func<Func<CancellationToken, ValueTask<T>>, CancellationToken, ValueTask<T>> Instance = static (callback, ct) => callback(ct); | ||
} |
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.
Is this actually necessary? I seem to remember the C# compiler folding identical lambdas into the same method definition (but maybe I'm misremembering?)
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCache.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCacheEntryOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCacheEntryOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCacheEntryOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/HybridCacheEntryOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Hybrid/IHybridCacheSerializer.cs
Outdated
Show resolved
Hide resolved
await @this.RemoveAsync(key, cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
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.
Any tests to add in this repo for the functionality that's here?
woohoo! does anyone in runtime (@stephentoub perhaps) have insight into the CI failure? this doesn't occur locally:
CI failure:
|
…brid/IHybridCacheSerializer.cs Co-authored-by: Stephen Toub <[email protected]>
…brid/HybridCacheEntryOptions.cs Co-authored-by: Stephen Toub <[email protected]>
…brid/HybridCacheEntryOptions.cs Co-authored-by: Stephen Toub <[email protected]>
Do you have a link to the failure information? |
most of the red crosses above; example: https://github.com/dotnet/runtime/runs/27757293802 |
I'd rack it up to infrastructure hiccups unless it happens again in this next run. |
This is a draft implementation of #100290