Skip to content

Instantly share code, notes, and snippets.

@dkomanov
Created May 25, 2020 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkomanov/543986105c30ab3a443c1a16b2d0dd1a to your computer and use it in GitHub Desktop.
Save dkomanov/543986105c30ab3a443c1a16b2d0dd1a to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-3] demo for stack trace
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