Last active
September 20, 2019 06:18
-
-
Save adamw/b1dfd42e6f631461812481dd9c334e2d 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 insertUserInTx: IO[Int] = insertUser.transact(transactor) | |
// (2) BEGIN; INSERT; COMMIT; sendEmail(); | |
val result2: IO[Unit] = insertUserInTx.flatMap(_ => sendEmail) | |
// (3) sendEmail(); BEGIN; INSERT; COMMIT; | |
val result3: IO[Int] = sendEmail.flatMap(_ => insertUserInTx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment