EitherNet Versions Save

A pluggable sealed API result type for modeling Retrofit responses.

1.8.1

2 months ago
  • Fix: (hopefully) fix kdocs publishing for test fixtures.
  • Update to Kotlin 1.9.22.

What's Changed

Full Changelog: https://github.com/slackhq/EitherNet/compare/1.8.0...1.8.1

1.8.0

5 months ago
  • Fix: Deprecate old fold() functions and introduce new ones that use the underlying value rather than Success. This was an oversight in the previous implementation. Binary compatibility is preserved.
  • Enhancement: Mark functions inline where possible to allow carried over context (i.e. in suspend functions, etc)
  • Enhancement: Use contracts to inform the compiler about possible calls to lambdas.
  • New: Add fluent onSuccess and onFailure* functional extension APIs to ApiResult.

What's Changed

Full Changelog: https://github.com/slackhq/EitherNet/compare/1.7.0...1.8.0

1.7.0

5 months ago
  • Enhancement: Add new ApiResult<*, *>.successOrNothing() and ApiResult.Failure<*>.exceptionOrNull() functional extension APIs.
  • Update to Kotlin 1.9.20.

What's Changed

Full Changelog: https://github.com/slackhq/EitherNet/compare/1.6.0...1.7.0

1.6.0

6 months ago
  • Enhancement: Add shouldRetry parameter to retryWithExponentialBackoff() to allow conditional short-circuiting of retries.

What's Changed

Full Changelog: https://github.com/slackhq/EitherNet/compare/1.5.0...1.6.0

1.5.0

8 months ago
  • New: Add new successOrNull, successOrElse, and fold functional extension APIs to ApiResult. These allow easy happy path-ing in user code to coerce results into a concrete value.
  • Update to Kotlin 1.9.0.

1.4.1

10 months ago
  • Enhancement: Gracefully handle Unit-returning endpoints when encountering a 204 or 205 response code.

Thanks to @JDSM01 for contributing to this release!

1.4.0

11 months ago

Happy new year!

A common pattern in making network requests is to retry with exponential backoff. EitherNet now ships with a highly configurable retryWithExponentialBackoff() function for this case.

// Defaults for reference
val result = retryWithExponentialBackoff(
  maxAttempts = 3,
  initialDelay = 500.milliseconds,
  delayFactor = 2.0,
  maxDelay = 10.seconds,
  jitterFactor = 0.25,
  onFailure = null, // Optional Failure callback for logging
) {
    api.getData()
}
  • Update to Kotlin 1.8.21.
  • Update to Kotlin Coroutines 1.7.1.
  • EitherNet now depends on org.jetbrains.kotlinx:kotlinx-coroutines-core.

1.3.1

1 year ago
  • Fix missing Gradle module metadata for test fixtures.

1.3.0

1 year ago
  • Update to Kotlin 1.8.0.
  • Fix: Fix exception on annotation traversal when target is not present
  • Fix: Publish test-fixtures artifact sources.
  • Update to JVM target 11.

What's Changed

New Contributors

Full Changelog: https://github.com/slackhq/EitherNet/compare/1.2.1...1.3.0

1.2.1

2 years ago
  • Update to Kotlin 1.6.10.
  • Promote test-fixtures APIs to stable.
  • Update kotlinx-coroutines to 1.6.0 (test-fixtures only)
  • Fix: test-fixtures artifact module metadata using the wrong artifact ID. They should correctly resolve when using Gradle's testFixtures(...) syntax.