Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell committed Feb 1, 2024
1 parent 95cfe4b commit de07db3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ public static IServiceCollection AddTypedDistributedCache(this IServiceCollectio

public sealed class TypedDistributedCacheOptions
{
// TBD
}

2 changes: 2 additions & 0 deletions src/Caching/Caching/src/DistributedCacheT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public ValueTask<T> GetAsync<TState>(string key, TState state, Func<TState, Canc

}

ValueTask IDistributedCache<T>.RefreshAsync(string key, CancellationToken cancellationToken) => new(_backend.RefreshAsync(key, cancellationToken));

private ValueTask<T> GetBufferedBackendAsync<TState>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> callback, DistributedCacheEntryOptions? options, CancellationToken cancellationToken)
{
var buffer = new RecyclableArrayBufferWriter<byte>();
Expand Down
7 changes: 6 additions & 1 deletion src/Caching/Caching/src/IBufferDistributedCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
using System.Buffers;

namespace Microsoft.Extensions.Caching.Distributed;
interface IBufferDistributedCache : IDistributedCache
public interface IBufferDistributedCache : IDistributedCache
{
ValueTask<bool> TryGetAsync(string key, IBufferWriter<byte> destination, CancellationToken cancellationToken);
ValueTask SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken cancellationToken);
}

public interface IDistributedCacheInvalidation : IDistributedCache
{
event Func<string, ValueTask> CacheKeyInvalidated;
}
2 changes: 2 additions & 0 deletions src/Caching/Caching/src/IDistributedCacheT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ public interface IDistributedCache<T>
ValueTask<T> GetAsync<TState>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> callback, DistributedCacheEntryOptions? options = null, CancellationToken cancellationToken = default);

ValueTask RemoveAsync(string key, CancellationToken cancellationToken = default);

ValueTask RefreshAsync(string key, CancellationToken cancellationToken = default);
}

6 changes: 6 additions & 0 deletions src/Caching/Caching/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#nullable enable
Microsoft.Extensions.Caching.Distributed.DistributedCacheServiceExtensions
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.SetAsync(string! key, System.Buffers.ReadOnlySequence<byte> value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions! options, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.TryGetAsync(string! key, System.Buffers.IBufferWriter<byte>! destination, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<bool>
Microsoft.Extensions.Caching.Distributed.ICacheSerializer<T>
Microsoft.Extensions.Caching.Distributed.ICacheSerializer<T>.Deserialize(System.Buffers.ReadOnlySequence<byte> source) -> T
Microsoft.Extensions.Caching.Distributed.ICacheSerializer<T>.Serialize(T value, System.Buffers.IBufferWriter<byte>! target) -> void
Microsoft.Extensions.Caching.Distributed.IDistributedCache<T>
Microsoft.Extensions.Caching.Distributed.IDistributedCache<T>.GetAsync(string! key, System.Func<System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>>! callback, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<T>
Microsoft.Extensions.Caching.Distributed.IDistributedCache<T>.GetAsync<TState>(string! key, TState state, System.Func<TState, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>>! callback, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<T>
Microsoft.Extensions.Caching.Distributed.IDistributedCache<T>.RefreshAsync(string! key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
Microsoft.Extensions.Caching.Distributed.IDistributedCache<T>.RemoveAsync(string! key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
Microsoft.Extensions.Caching.Distributed.IDistributedCacheInvalidation
Microsoft.Extensions.Caching.Distributed.IDistributedCacheInvalidation.CacheKeyInvalidated -> System.Func<string!, System.Threading.Tasks.ValueTask>!
Microsoft.Extensions.Caching.Distributed.TypedDistributedCacheOptions
Microsoft.Extensions.Caching.Distributed.TypedDistributedCacheOptions.TypedDistributedCacheOptions() -> void
static Microsoft.Extensions.Caching.Distributed.DistributedCacheServiceExtensions.AddTypedDistributedCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Expand Down

0 comments on commit de07db3

Please sign in to comment.