AsyncIter.new
This commit is contained in:
parent
bf84aa29ef
commit
09d49808cc
|
@ -120,7 +120,8 @@ proc getPendingBlocks(
|
||||||
CatchableError,
|
CatchableError,
|
||||||
"Future for block id not found, tree cid: " & $manifest.treeCid & ", index: " & $index)
|
"Future for block id not found, tree cid: " & $manifest.treeCid & ", index: " & $index)
|
||||||
|
|
||||||
newAsyncIter[(?!bt.Block, int)](genNext, isFinished)
|
# newAsyncIter[(?!bt.Block, int)](genNext, isFinished)
|
||||||
|
asynciter.AsyncIter.new[(?!bt.Block, int)](genNext, isFinished)
|
||||||
|
|
||||||
proc prepareEncodingData(
|
proc prepareEncodingData(
|
||||||
self: Erasure,
|
self: Erasure,
|
||||||
|
|
|
@ -64,6 +64,12 @@ proc newAsyncIter*[T](genNext: GenNext[Future[T]], isFinished: IsFinished, finis
|
||||||
iter.next = next
|
iter.next = next
|
||||||
return iter
|
return iter
|
||||||
|
|
||||||
|
proc new*[T](_: type AsyncIter, genNext: GenNext[Future[T]], isFinished: IsFinished, finishOnErr: bool = true): AsyncIter[T] =
|
||||||
|
newAsyncIter[T](
|
||||||
|
genNext,
|
||||||
|
isFinished
|
||||||
|
)
|
||||||
|
|
||||||
proc emptyAsyncIter*[T](): AsyncIter[T] =
|
proc emptyAsyncIter*[T](): AsyncIter[T] =
|
||||||
## Creates an empty AsyncIter
|
## Creates an empty AsyncIter
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue