-
-
Save martinlechner1/8f8f48c55cf8ca8a9bd86f0839b5ac59 to your computer and use it in GitHub Desktop.
This file contains 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
# ZIO usage | |
## ZLayer for dependency management | |
- Type safe | |
- Composable | |
- No Magic / No reflection (unlike Guice) | |
- Support for modeling failing dependencies (such as config loading) | |
## Module pattern | |
## ZIO as effect system | |
- Modeling concurrency in a lazy evaluated approach | |
- This allows the effect system to optimize operations -> high performance | |
- Main appeal for business logic: Bifunctor IO: `IO[E, A]` | |
- Typesafe way of handling business errors | |
- A lot of useful stuff for concurrency | |
## Vs Future | |
- Referential Transparency => easier to reason about code | |
- Better performance (=> Lower costs) | |
## Vs Cats-Effect | |
- Similar to IO would be EitherT[IO, E, A] | |
- ZIO is more a framework and less, cats-effect a library | |
## Some cool things | |
### Retries | |
`.retry(Schedule.recurs(5).delayed[Clock](_ + 100.milliseconds)` | |
### Parallel processing | |
`.collectAllPar` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment