Skip to content

Commit

Permalink
publish 4.3.2
Browse files Browse the repository at this point in the history
and adjusted the #682 fix to work with Scala 2.11
  • Loading branch information
etorreborre committed Jul 10, 2018
1 parent d38da82 commit f51ee9e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ object TimedFuture {

def ap[A, B](fa: =>TimedFuture[A])(ff: =>TimedFuture[(A) => B]): TimedFuture[B] = {
val newCallback = { es: ExecutorServices =>
val ffRan = Future(ff.runNow(es))(es.executionContext).flatMap(identity)(es.executionContext)
val faRan = Future(fa.runNow(es))(es.executionContext).flatMap(identity)(es.executionContext)
faRan.flatMap(a => ffRan.map(f => f(a))(es.executionContext))(es.executionContext)
implicit val ec: ExecutionContext = es.executionContext

val ffRan = Future(ff.runNow(es)).flatMap(identity)
val faRan = Future(fa.runNow(es)).flatMap(identity)
faRan.flatMap(a => ffRan.map(f => f(a))(es.executionContext))
}
TimedFuture(newCallback)
}
Expand All @@ -59,9 +61,11 @@ object TimedFuture {

override def ap[A, B](fa: =>TimedFuture[A])(ff: =>TimedFuture[(A) => B]): TimedFuture[B] = {
val newCallback = { es: ExecutorServices =>
Future(ff.runNow(es))(es.executionContext).flatten.flatMap { f =>
Future(fa.runNow(es))(es.executionContext).flatten.map(f)(es.executionContext)
}(es.executionContext)
implicit val ec: ExecutionContext = es.executionContext

Future(ff.runNow(es)).flatMap(identity).flatMap { f =>
Future(fa.runNow(es)).flatMap(identity).map(f)
}
}
TimedFuture(newCallback)
}
Expand Down
6 changes: 6 additions & 0 deletions notes/4.3.2.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Maintenance version with an additional fix for possible stackoverflow exceptions on large specifications.

## Fixes

* **core** #682 use constant stack running `TimedFuture` sequentially, too take constant stack while running examples in parallel (Edmund Noble)

2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "4.3.1"
version in ThisBuild := "4.3.2"

0 comments on commit f51ee9e

Please sign in to comment.