Finch 0.9.2
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 importio.finch._
. To migrate remove importsio.finch.request.*
from your codebase. io.finch.request.RequestError
has been renamed toio.finch.Error
.x.toFuture
andx.toFutureException
have been removed. UseFuture.value
andFuture.exception
instread.
Deprecations
Output.Failure(map: Map[String, String])
is deprecated in favor ofOutput.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.