Skip to content

Finch 0.9.2

Compare
Choose a tag to compare
@vkostyukov vkostyukov released this 05 Dec 17:25
· 1438 commits to master since this release

This release contains a variety of performance improvements for body readers and extracting endpoints as well as new API for failures.

Upgraded Dependencies

  • Finagle 6.31
  • Circe 0.2.1
  • Cats 0.3.0 (yes! Finch now uses Cats' Eval to empower endpoints' laziness)

Breaking API Changes

  • All the finch-core is now available by a single import io.finch._. To migrate remove imports io.finch.request.* from your codebase.
  • io.finch.request.RequestError has been renamed to io.finch.Error.
  • x.toFuture and x.toFutureException have been removed. Use Future.value and Future.exception instread.

Deprecations

  • Output.Failure(map: Map[String, String]) is deprecated in favor of Output.Failure(cause: Exception) and will be removed in 0.9.3.

Performance Improvements

This is the first Finch release with first bits of performance work:

  • 30% less allocations and 20% less running time for body* readers.
  • 10% less allocations and 10% less running time for extractors int, string, long, boolean.

The bottom line is Finch now gives only 5-6% overhead (both allocations and running time) on top of bare metal Finagle.

New Features

New Failures API

Output.Failure now wraps Exception, which might be encoded into an HTTP response by EncodeResponse[Exception]. See docs for more details.

Pretty Printers for Argonaut and Circe

It's now possible to override the default pretty printer for Circe and Argonaut. For example, the following import defines Circe's encoder that drops null keys in JSON objects. See docs for more details.

import io.finch.circe.dropNullKeys._

New Examples and Best Practices

  • There is a new sub-project examples that contains always up-to-date Finch examples.
  • New docs section called "Best Practices" is aimed to collect all the known approaches and techniques that work reasonably good with Finch. Feel free to open a PR to share your experience.