Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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