travisbrown on main
Update cats-effect, cats-effect… (compare)
travisbrown on main
Update sbt-scalajs, scalajs-com… (compare)
travisbrown on main
Update scalatest to 3.2.7 (#486) (compare)
travisbrown on main
Update scalacheck to 1.15.3 (#4… (compare)
my fix is in Done.bind method, line 106 Step.scala
as you can see, f(value)
is computed twice. if i extract local, the problem goes away
"foreach" should "perform an operation on all values in a grouped stream" in forAll { (eav: EnumeratorAndValues[Int]) =>
var total = 0
val iteratee = foreach[Vector[Int]](is => total += is.sum)
val eavg = EnumeratorAndValues(
eav.enumerator.grouped(3),
eav.values.grouped(3).toVector)
assert(eavg.resultWithLeftovers(iteratee) === F.pure(((), Vector.empty)) && total === eavg.values.flatten.sum)
}
foreach
bug? That should be backported anyway, so maybe we could just cut an 0.9.1 today with that and not publish 0.10.0 with a potential stack bug?
@travisbrown Hi there
I have a question regarding .ensure
in Enumerator
and Iteratee
.
Is it called after last step processed or failed?
Let's say, I have an Enumerator
of futures, and I want to close connection on reading failure or when I'm done with stream.
Currently it seems like .ensure
is called before the last element is processed (if I add it here):
https://github.com/ImLiar/finch/blob/246fd7ccf80e9da9d8fedd409fbf09ce2d7bda18/iteratee/src/main/scala/io/finch/iteratee/package.scala#L40
I got an exception every time when I write inside of the readerWriter
,
https://github.com/ImLiar/finch/blob/246fd7ccf80e9da9d8fedd409fbf09ce2d7bda18/iteratee/src/test/scala/io/finch/iteratee/EnumerateEndpointSpec.scala#L45 saying that writer is already closed
Option
and Try
supported by explicitly lazy methods with the Eval
suffix.
And one more question
I have two Enumerator
s and append
one to another. Both of them have ensureEval
. What will be the behaviour in that case? Will the ensure
happen after both streams are done:stream1 -> stream2 -> ensure1 -> ensure2
or it's gonna be like:stream1 -> ensure1 -> stream2 -> ensure2
?