Tests and package name updated

This commit is contained in:
Savya Bikram Shah
2026-05-07 17:42:48 +05:45
parent 9f620084b2
commit 6a8a6e46f0
93 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
using System.Threading;
using System.Threading.Tasks;
#if UNITASK_SUPPORT
using Cysharp.Threading.Tasks;
#endif
namespace Darkmatter.Fonepay
{
internal static class FonepayAsyncBridge
{
#if UNITASK_SUPPORT
internal static FonepayAsync<T> Wrap<T>(Task<T> task, CancellationToken ct = default)
=> new FonepayAsync<T>(task.AsUniTask().AttachExternalCancellation(ct));
internal static FonepayAsync Wrap(Task task, CancellationToken ct = default)
=> new FonepayAsync(task.AsUniTask().AttachExternalCancellation(ct));
#else
// Task is already awaitable — wrap directly, no Awaitable needed
internal static FonepayAsync<T> Wrap<T>(Task<T> task, CancellationToken ct = default)
=> new FonepayAsync<T>(task);
internal static FonepayAsync Wrap(Task task, CancellationToken ct = default)
=> new FonepayAsync(task);
#endif
}
}