Created
November 11, 2013 17:06
-
-
Save pchiusano/7416609 to your computer and use it in GitHub Desktop.
Worst case scenario for `Nondeterminism[Future]`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This bombs with a SOE | |
object Main extends App { | |
val F = Nondeterminism[Future] | |
val N = 10000 | |
val worstCaseScenario = | |
(0 until N).foldLeft(Future { Thread.sleep(50000) })((a,b) => | |
F.both(a, F.point(b)).map(_._1) | |
) | |
worstCaseScenario.run | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment