In this article, we ll discuss some important features available which can be learned and implemented quickly when migrating from directly Java 8 to Java 17.
Transactional Effects in Scala by
Introduction
This post was inspired by a StackOverflow answer for the question Compose Futures with Recovery in Scala: Is it possible to compose
Futures in a manner where, if one of them fails, a previous
Future s execution result will be rolled back via some function?
The Problem
F[ ], so we can say: How can we compose effects
F[ ] in a manner where, if one of them fails, the previous
F[ ] execution result will be rolled back via some function? This behavior is similar to what we know as a Transaction.
Solution
cats-effect version Scala 2 3 6 8 9 11 Here goes syntax trick - in for-comprehension will be invoked `flatMap` of this wrapper and not of underlying effect.