Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit 0c4d442

Browse files
committed
Initial Commit
1 parent 63110fe commit 0c4d442

File tree

6 files changed

+619
-88
lines changed

6 files changed

+619
-88
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Microsoft.Extensions.Caching.Distributed;
2+
3+
namespace CacheFlow.Abstractions;
4+
5+
/// <summary>
6+
/// Represents a buffer-based distributed cache entry that supports efficient memory usage.
7+
/// </summary>
8+
public interface IBufferDistributedCacheEntry : IAsyncDisposable, IDisposable
9+
{
10+
/// <summary>
11+
/// Gets the buffer for writing cache data.
12+
/// </summary>
13+
Memory<byte> Buffer { get; }
14+
15+
/// <summary>
16+
/// Sets the length of valid data in the buffer.
17+
/// </summary>
18+
/// <param name="length">The length of valid data.</param>
19+
void SetLength(int length);
20+
21+
/// <summary>
22+
/// Completes the cache entry with the specified options.
23+
/// </summary>
24+
/// <param name="options">The cache entry options.</param>
25+
void Complete(DistributedCacheEntryOptions options);
26+
27+
/// <summary>
28+
/// Asynchronously completes the cache entry with the specified options.
29+
/// </summary>
30+
/// <param name="options">The cache entry options.</param>
31+
/// <param name="token">Optional cancellation token.</param>
32+
/// <returns>A task representing the asynchronous operation.</returns>
33+
Task CompleteAsync(DistributedCacheEntryOptions options, CancellationToken token = default);
34+
}

0 commit comments

Comments
 (0)