Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (17 sloc) 0.518 kB
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Simple.Data
{
public static class BufferedEnumerable
{
public static IEnumerable<T> Create<T>(Func<Maybe<T>> iterator, Action cleanup)
{
var enumerable = new BufferedEnumerable<T>();
var task = new Task(() => enumerable.Iterate(iterator));
task.ContinueWith(t => cleanup());
task.Start();
return enumerable;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.