Skip to content
This repository was archived by the owner on Aug 6, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ dist: trusty
sudo: false
group: beta
scala:
- 2.12.1
- 2.11.8
- 2.12.8
- 2.11.12
jdk:
- oraclejdk8
cache:
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import interplay.ScalaVersions._
import scalariform.formatter.preferences._

val specsVersion = "3.8.9"
val specsVersion = "4.3.6"
val specsBuild = Seq(
"specs2-core",
"specs2-junit",
Expand All @@ -27,7 +27,7 @@ lazy val `play-iteratees` = project
scalaVersion := scala212,
crossScalaVersions := Seq(scala212, scala211),
libraryDependencies ++= Seq(
"org.scala-stm" %% "scala-stm" % "0.8"
"org.scala-stm" %% "scala-stm" % "0.9"
) ++ specsBuild.map(_ % Test)
)

Expand All @@ -39,7 +39,7 @@ lazy val `play-iteratees-reactive-streams` = project
scalaVersion := scala212,
crossScalaVersions := Seq(scala212, scala211),
libraryDependencies ++= Seq(
"org.reactivestreams" % "reactive-streams" % "1.0.0"
"org.reactivestreams" % "reactive-streams" % "1.0.2"
) ++ specsBuild.map(_ % Test)
).dependsOn(`play-iteratees`)

Expand Down
21 changes: 10 additions & 11 deletions iteratees/src/main/scala/play/api/libs/iteratee/Concurrent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,8 @@ object Concurrent {
Iteratee.flatten(ready.flatMap { _ =>

val downToZero = atomic { implicit txn =>
val ready = commitReady().toMap
iteratees.transform(commitReady().map(_._2) ++ _)
(interested.length > 0 && iteratees().length <= 0)

}
def result(): Iteratee[E, Unit] = if (in == Input.EOF || closeFlag) Done((), Input.Empty) else Cont(step)
if (downToZero) Future(interestIsDownToZero())(pec).map(_ => result())(dec) else Future.successful(result())
Expand All @@ -628,16 +626,16 @@ object Concurrent {

new Hub[E] {

def noCords() = iteratees.single().isEmpty
def noCords(): Boolean = iteratees.single().isEmpty

def close(): Unit = {
closeFlag = true
}

def closed() = closeFlag
def closed(): Boolean = closeFlag

val redeemed = Ref(None: Option[Try[Iteratee[E, Unit]]])
def getPatchCord() = new Enumerator[E] {
def getPatchCord(): Enumerator[E] = new Enumerator[E] {

def apply[A](it: Iteratee[E, A]): Future[Iteratee[E, A]] = {
val result = Promise[Iteratee[E, A]]()
Expand Down Expand Up @@ -819,10 +817,10 @@ object Concurrent {
}
case err => folder(err)
}(ec)
toReturn.onFailure {
case e => doneIteratee.failure(e)
toReturn.andThen {
case Failure(e) => doneIteratee.failure(e)
case _ =>
}(dec)
toReturn
}
}

Expand All @@ -848,10 +846,11 @@ object Concurrent {
val (consumeRemaining, remaining) = Concurrent.joined[E]
result.success((a, remaining))
consumeRemaining
}(dec)).onFailure {
case e => result.tryFailure(e)
}(dec)).onComplete {
case Failure(e) => result.tryFailure(e)
case _ =>
}(dec)

result.future
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,10 @@ object Enumerator {
Future.successful(None)
}(dec)

next.onFailure {
case reason: Exception =>
next.onComplete {
case Failure(reason) =>
onError(reason.getMessage(), Input.Empty)
case _ =>
}(dec)

next.onComplete {
Expand Down