Skip to content

Commit

Permalink
Merge pull request #2257 from dwhjames/topic/iteratee-ec-prepare
Browse files Browse the repository at this point in the history
Remove unnecessary execution context preparation from flatMap on iteratees
  • Loading branch information
richdougherty committed Feb 12, 2014
2 parents e10e808 + 19d49a9 commit 9595312
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -491,7 +491,7 @@ trait Iteratee[E, +A] {
def flatMap[B](f: A => Iteratee[E, B])(implicit ec: ExecutionContext): Iteratee[E, B] = {
self.pureFlatFoldNoEC { // safe: folder either yields value immediately or executes with another EC
case Step.Done(a, Input.Empty) => executeIteratee(f(a))(ec /* still on same thread; let executeIteratee do preparation */ )
case Step.Done(a, e) => executeIteratee(f(a))(ec.prepare /* still on same thread; let executeIteratee do preparation */ ).pureFlatFold {
case Step.Done(a, e) => executeIteratee(f(a))(ec /* still on same thread; let executeIteratee do preparation */ ).pureFlatFold {
case Step.Done(a, _) => Done(a, e)
case Step.Cont(k) => k(e)
case Step.Error(msg, e) => Error(msg, e)
Expand Down

0 comments on commit 9595312

Please sign in to comment.