Created
June 7, 2019 20:10
-
-
Save adamw/d5aeeb1b44535004e5fb7539d7aab295 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.effectAsync[Any, Throwable, Unit] { cb => | |
ec3.submit(new Runnable { | |
override def run(): Unit = { | |
println(Thread.currentThread().getName + " (async)") | |
cb(IO.fail(new IllegalStateException())) | |
} | |
}) | |
} | |
run("async shift error") { | |
ae.ensuring(printThread.either) | |
} | |
/* | |
Outputs: | |
-- async shift error -- | |
ec3-1-1627960023 (async) | |
zio-default-async-11-853993923 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment