3 instantiations of StampedeState
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
15 references to StampedeState
Microsoft.Extensions.Caching.Hybrid (9)
Internal\DefaultHybridCache.cs (4)
145out HybridCacheEntryFlags flags, out bool canBeCanceled, out StampedeState<TState, T>? stampede, out ValueTask<T> result);
178out HybridCacheEntryFlags flags, out bool canBeCanceled, out StampedeState<TState, T>? stampede, out ValueTask<T> result);
223out StampedeState<TState, T>? stampede,
327var state = new StampedeState<T, T>(this, new StampedeKey(key, flags), TagSet.Create(tags), cancellationToken);
Internal\DefaultHybridCache.Stampede.cs (4)
17public bool GetOrCreateStampedeState<TState, T>(string key, HybridCacheEntryFlags flags, out StampedeState<TState, T> stampedeState, bool canBeCanceled, IEnumerable<string>? tags)
23if (TryJoinExistingSession(this, stampedeKey, out StampedeState<TState, T>? existing))
75[NotNullWhen(true)] out StampedeState<TState, T>? stampedeState)
79if (found is not StampedeState<TState, T> tmp)
Microsoft.Extensions.Caching.Hybrid.Tests (6)
StampedeTests.cs (6)
77var state = new DefaultHybridCache.StampedeState<string, string>(cache, in key, TagSet.Empty, true);
90Assert.True(cache.GetOrCreateStampedeState<int, int>(Key, Flags, out var old, true, null));
104Assert.True(cache.GetOrCreateStampedeState<int, int>(Key, Flags, out var replacement, false, null));
111Assert.False(cache.GetOrCreateStampedeState<int, int>(Key, Flags, out var joined, false, null));
544Assert.True(cache.GetOrCreateStampedeState<int, T>(Me(), Flags, out var stampede, canBeCanceled: true, tags: null));
547Assert.False(cache.GetOrCreateStampedeState<int, T>(Me(), Flags, out var joined, canBeCanceled: true, tags: null));