Created
May 25, 2020 16:46
-
-
Save dkomanov/543986105c30ab3a443c1a16b2d0dd1a to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-3] demo for stack trace
This file contains 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
def stackTrace(implicit ec: ExecutionContext): Any = { | |
Await.result( | |
Future.successful(1) | |
.map(v => v + 1) | |
.flatMap(v => Future.successful(v)) | |
.map { v => | |
new IllegalStateException().printStackTrace() | |
v | |
}, | |
10.seconds | |
) | |
} | |
stackTrace(scala.concurrent.ExecutionContext.Implicits.global) | |
stackTrace(com.komanov.future.directExecutionContext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment