Last active
June 7, 2019 20:09
-
-
Save adamw/97bb19ff5608ab3306c1da28db75197b to your computer and use it in GitHub Desktop.
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
val ae = IO.async[Unit] { cb => | |
ec3.submit(new Runnable { | |
override def run(): Unit = { | |
println(Thread.currentThread().getName + " (async)") | |
cb(Left(new IllegalStateException())) | |
} | |
}) | |
} | |
run("async error") { | |
ae.guarantee(printThread) | |
} | |
/* | |
Outputs: | |
-- async error -- | |
ec3-1-785992331 (async) | |
ec3-1-785992331 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment