Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val a = IO.effectAsync[Any, Nothing, Unit] { cb =>
- ec3.submit(new Runnable {
- override def run(): Unit = {
- println(Thread.currentThread().getName + " (async)")
- cb(UIO.unit)
- }
- })
- }
- run("async") {
- printThread *> a *> printThread
- }
- /*
- Outputs:
- -- async --
- main
- ec3-1-1627960023 (async)
- zio-default-async-7-1702146597
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement