Back to directory
svroonland avatar

rezilience

ZIO-native utilities for making resilient distributed systems. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/svroonland/rezilience.git

164

Stars

20

Forks

1

Watchers

Apache-2.0

License

Rezilience

Use and like this library? Consider sponsoring its ongoing development and maintenance

rezilience is a ZIO-native collection of policies for making asynchronous systems more resilient to failures.

It is inspired by Polly, Resilience4J and Akka.

It consists of these policies:

  • CircuitBreaker
  • Bulkhead
  • RateLimiter
  • Retry
  • Timeout

Features / Design goals

  • Type-safety: all errors that can result from any of the rezilience policies are encoded in the method signatures, so no unexpected RuntimeExceptions.
  • Support for your own error types (the E in ZIO[R, E, A]) instead of requiring your effects to have Exception as error type
  • Lightweight: rezilience uses only ZIO fibers and will not create threads or block
  • Switchable at runtime with two transition modes
  • Resource-safe: built on ZIO's ZManaged, any allocated resources are cleaned up safely after use.
  • Interrupt safe: interruptions of effects wrapped by rezilience policies are handled properly.
  • Thread-safe: all policies are safe under concurrent use.
  • ZIO integration: some policies take for example ZIO Schedules and rezilience tries to help type inference using variance annotations
  • Metrics: all policies (will) provide usage metrics for monitoring purposes
  • Composable: policies can be composed into one overall policy
  • Discoverable: no syntax extensions or implicit conversions, just plain scala

Documentation

Documentation

Further questions? Look for the #rezilience channel on the ZIO Discord: https://discord.gg/2ccFBr4

Installation

Sonatype Nexus (Releases) Sonatype Nexus (Snapshots)

Add to your build.sbt:

libraryDependencies += "nl.vroste" %% "rezilience" % "<version>"

Used by

If you are using this library and find it useful, please consider adding your company or project to the list below!

Releases

This release fixes an issue with the Bulkhead getting stuck in the half-open state when the first call in that state is interrupted. Changes

Prevent interruption of stateful HalfOpen logic @rockyracc...

Minor fixes for the CircuitBreaker + dependency upgrades. Changes

Initialize circuit breaker metrics @zyrrl (#484) Fix circuit-breacker's getting stuck in half open state @leoniv (#482) Update scalaf...

The jar for 0.10.2 for scala 2.13 was reported to be empty after publishing to Maven Central, attempting to fix that in this release. Changes

Update zio-streams, zio-test, zio-test-sbt to 2.1.9 @scal...

This release stores compatibility with ZIO 2.1.7+, due to a change in ZIO 2.1.7. See the note at https://github.com/svroonland/rezilience/releases/tag/v0.10.1 for more details. Changes

Update zio-st...

This is a republish of v0.10.0, due to publishing issues with that version. Below is a copy of the release notes of version v0.10.0 This release brings dependency updates, including upgraded ZIO confi...