上传框架,上传unitask

This commit is contained in:
2025-04-11 09:56:06 +08:00
parent 9f9bb87821
commit 4e3c6861df
355 changed files with 73049 additions and 85 deletions

View File

@@ -0,0 +1,47 @@
using System.Threading;
namespace Cysharp.Threading.Tasks.Linq
{
public static partial class UniTaskAsyncEnumerable
{
public static IUniTaskAsyncEnumerable<T> Empty<T>()
{
return Cysharp.Threading.Tasks.Linq.Empty<T>.Instance;
}
}
internal class Empty<T> : IUniTaskAsyncEnumerable<T>
{
public static readonly IUniTaskAsyncEnumerable<T> Instance = new Empty<T>();
Empty()
{
}
public IUniTaskAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
{
return _Empty.Instance;
}
class _Empty : IUniTaskAsyncEnumerator<T>
{
public static readonly IUniTaskAsyncEnumerator<T> Instance = new _Empty();
_Empty()
{
}
public T Current => default;
public UniTask<bool> MoveNextAsync()
{
return CompletedTasks.False;
}
public UniTask DisposeAsync()
{
return default;
}
}
}
}