Git Product home page Git Product logo

finch's Introduction

Finch is a thin layer of purely functional basic blocks atop of Finagle for building composable REST APIs. Its mission is to provide the developers simple and robust REST API primitives being as close as possible to the bare metal Finagle API.

Badges

Build Status Coverage Status Gitter Maven Central

Modules

Finch uses multi-project structure and contains of the following modules:

Installation

Every Finch module is published at Maven Central. Use the following sbt snippet ...

  • for the stable release:
libraryDependencies ++= Seq(
  "com.github.finagle" %% "[finch-module]" % "0.9.1"
)
  • for the SNAPSHOT version:
resolvers += Resolver.sonatypeRepo("snapshots")

libraryDependencies ++= Seq(
  "com.github.finagle" %% "[finch-module]" % "0.9.2-SNAPSHOT" changing()
)

Hello World!

This "Hello World!" example is built with the 0.9.2-SNAPSHOT version of finch-core.

import io.finch._
import com.twitter.finagle.Http

val api: Endpoint[String] = get("hello") { Ok("Hello, World!") }

Http.serve(":8080", api.toService)

See examples sub-project for more complete examples.

Performance

We use end-to-end service benchmark to compare performance between bare-bones Finagle service using Jackson for JSON parsing/serialization against Finch service empowered by Circe. Roughly, the Finch + Circe configuration gives the overhead less than 5% in terms of performance and less than 10% in terms of allocations, compared to Finagle + Jackson.

GET /JSON-Object

Benchmark                                             Mode  Cnt          Score        Error   Unit

FinchCirce.getJsonObj                                 avgt   10        352.658 ±     49.267  ms/op
FinchCirce.getJsonObj:·gc.alloc.rate.norm             avgt   10  366909071.657 ±  19659.934   B/op
FinagleJackson.getJsonObj                             avgt   10        372.074 ±     57.819  ms/op
FinagleJackson.getJsonObj:·gc.alloc.rate.norm         avgt   10  328441359.200 ±  78088.424   B/op

POST /JSON-Object

Benchmark                                             Mode  Cnt      Score            Error   Unit

FinchCirce.postJsonObj                                avgt   10        243.935 ±     29.455  ms/op
FinchCirce.postJsonObj:·gc.alloc.rate.norm            avgt   10  399187222.400 ±  84523.131   B/op
FinagleJackson.postJsonObj                            avgt   10        235.564 ±     46.433  ms/op
FinagleJackson.postJsonObj:·gc.alloc.rate.norm        avgt   10  376365652.800 ± 169854.875   B/op

Documentation

Adopters

Contributing

There are plenty of ways to contribute into Finch:

  • Give it a star
  • Join the Gitter room and leave a feedback or help with answering users' questions
  • Submit a PR (there is an issue label "easy" for newcomers)
  • Be cool and wear a Finch T-Shirt

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

finch's People

Contributors

vkostyukov avatar travisbrown avatar rpless avatar mimilei avatar benwhitehead avatar benjumanji avatar derrickburns avatar sergeykolbasov avatar ilya-murzinov avatar jenshaase avatar penland365 avatar rodrigopr avatar yanana avatar tarossi avatar nicmart avatar akiomik avatar amartinsn avatar andreyakinshin avatar andrestc avatar arnarthor avatar bryce-anderson avatar caniszczyk avatar chester89 avatar haakonn avatar keeth avatar longcao avatar suls avatar mjkrumlauf avatar pasviegas avatar robsonpeixoto avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.