fromStream<A> static method

Conveyor<Task, A> fromStream<A>(
  1. Stream<A> s()
)

Implementation

static Conveyor<Task, A> fromStream<A>(Stream<A> s()) => Source.resource(Task.delay(() => new StreamIterator(s())),
    (StreamIterator<A> it) => Source.eval<Task, bool>(new Task(it.moveNext)).repeat().takeWhile(id).flatMap((_) => Source.eval(Task.delay(() => it.current))),
    (StreamIterator<A> it) => Source.eval_(new Task(() => new Future.value(unit).then((_) => it.cancel()))));