Skip to content

Instantly share code, notes, and snippets.

@martinlechner1

martinlechner1/ZIO

Created May 5, 2020
Embed
What would you like to do?
# 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
You can’t perform that action at this time.