using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Beam.Models;

namespace Beam {
    public class DownloadEnumerable<T>(IAsyncEnumerator<Ordered<T>> download) : IAsyncEnumerable<Ordered<T>> {
        public IAsyncEnumerator<Ordered<T>> Download { get; } = download;

        public IAsyncEnumerator<Ordered<T>> GetAsyncEnumerator(CancellationToken cancellationToken = default) 
            => Download;

        public static DownloadEnumerable<T> Empty()
            => new(Array.Empty<Ordered<T>>().ToAsyncEnumerable().GetAsyncEnumerator());
    }
}
