-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIResumableManager.cs
More file actions
22 lines (20 loc) · 1.46 KB
/
IResumableManager.cs
File metadata and controls
22 lines (20 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Diagnostics.CodeAnalysis;
using ResumableFunctions.Data;
namespace ResumableFunctions;
public interface IResumableManager
{
Task Save(ResumableAwaiter awaiter, IAsyncEnumerator<ResumableFunctionState> asyncEnumerator);
Task Save<T>(ResumableAwaiter awaiter, IAsyncEnumerator<ResumableFunctionState<T>> asyncEnumerator);
Task Remove(ResumableAwaiter awaiter, IAsyncEnumerator<ResumableFunctionState> asyncEnumerator);
Task Remove<T>(ResumableAwaiter awaiter, IAsyncEnumerator<ResumableFunctionState<T>> asyncEnumerator);
bool TryGetOriginalMethod(IAsyncEnumerable<ResumableFunctionState> enumerable, [NotNullWhen(true)] out RegisteredMethod? method);
bool TryGetOriginalMethod<T>(IAsyncEnumerable<ResumableFunctionState<T>> enumerable, [NotNullWhen(true)] out RegisteredMethod? method);
/// <summary>Restore state of stored function from <paramref name="filename"/></summary>
/// <remarks>You must choose correct <see cref="Resume(string)"/> method based on return type of original method.</remarks>
Task<IAsyncEnumerator<ResumableFunctionState>> Resume(string filename);
/// <inheritdoc cref="Resume(string)"/>
Task<IAsyncEnumerator<ResumableFunctionState<TOut>>> Resume<TOut>(string filename);
Task<IAsyncEnumerator<ResumableFunctionState>> Resume(string filename, object existingInstance);
Task<IAsyncEnumerator<ResumableFunctionState<TOut>>> Resume<TOut>(string filename, object existingInstance);
Task ResumeAll();
}