-
Notifications
You must be signed in to change notification settings - Fork 372
Expand file tree
/
Copy pathIDiskCache.cs
More file actions
29 lines (22 loc) · 912 Bytes
/
IDiskCache.cs
File metadata and controls
29 lines (22 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Threading.Tasks;
using System.IO;
namespace FFImageLoading.Cache
{
public interface IDiskCache
{
/// <summary>
/// Adds the file to cache and file saving queue if it does not exists.
/// </summary>
/// <param name="key">Key to store/retrieve the file.</param>
/// <param name="bytes">File data in bytes.</param>
/// <param name="duration">Specifies how long an item should remain in the cache.</param>
/// <param name="writeFinished">Action when write finishes.</param>
Task AddToSavingQueueIfNotExistsAsync(string key, byte[] bytes, TimeSpan duration, Action writeFinished = null);
Task<Stream> TryGetStreamAsync(string key);
Task RemoveAsync(string key);
Task ClearAsync();
Task<bool> ExistsAsync(string key);
Task<string> GetFilePathAsync(string key);
}
}