/// <summary> /// Collects the elements of an IAsyncEnumerator into a regular enumerable synchronously. /// <returns></returns> public static IProducerConsumerCollection <T> CollectSync <T>(this IAsyncEnumerable <T> e, int maxCount = 0) { return(e.Collect(maxCount: maxCount).GetAwaiter().GetResult()); }