Giter Site home page Giter Site logo

doytsujin / finch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from finagle/finch

0.0 1.0 0.0 8.39 MB

Scala combinator library for building Finagle HTTP services

Home Page: https://finagle.github.io/finch

License: Apache License 2.0

Scala 99.51% Shell 0.49%

finch's Introduction

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

Badges

Build Status Coverage Status Gitter Maven Central

Standard Modules

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

Additional Modules

Finch's Github organization has even more modules (these are, however, not published regularly; reach out if you need published artifacts):

Installation

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

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

Cats Effect and Twitter Futures

Starting with 0.25, Finch artifacts are published for both Twitter Futures (Endpoint[A]) and Cats Effects (Endpoint[F[_], A]):

  • Use finch-* artifacts for endpoints locked in Twitter Futures (legacy)
  • Use finchx-* artifacts for polymorphic endpoints (recommended)

Hello World!

This "Hello World!" example is built with just finchx-core (polymorphic endpoints):

import io.finch._, cats.effect.IO
import com.twitter.finagle.Http
import com.twitter.util.Await

object Main extends App with Endpoint.Module[IO] {
  val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
  Await.ready(Http.server.serve(":8080", api.toServiceAs[Text.Plain]))
}

See examples sub-project for more complete examples.

Quickstart

Use finch.g8 template to quickly bootstrap a minimal Finch project:

  • sbt new finch/finch.g8
  • cd helloworld
  • sbt run
  • curl http://localhost:8081/hello

Performance

We use wrk to load test Finch+Circe against Finagle+Jackson to get some insight on how much overhead, an idiomatic Finch application written in a purely functional way, involves on top of Finagle/Jackson. The results are quite impressive (for a pre-1.0 version): Finch performs on 95% of Finagle's throughput.

Here is the first three runs of the benchmark on 2013 MB Pro (2.8 GHz Intel Core i7 w/ 16G RAM).

Benchmark Run 1 Run 2 Run 3
Finagle + Jackson 29014.68 req/s 36783.21 req/s 39924.42 req/s
Finch + Circe 28762.84 req/s 36876.30 req/s 37447.52 req/s

Finch is also load tested against a number of Scala HTTP frameworks and libraries as part of the TechEmpower benchmark. The most recent round showed that Finch performs really well there, scoring a second place across all the Scala libraries.

Documentation

Adopters

Related Projects

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

The Finch project supports the Typelevel code of conduct and wants all of its channels (Gitter, GitHub, etc.) to be welcoming environments for everyone.

Finch is currently maintained by Vladimir Kostyukov, Travis Brown, Ryan Plessner, and Sergey Kolbasov. After the 1.0 release, all pull requests will require two sign-offs by a maintainer to be merged.

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 scala-steward avatar rpless avatar sergeykolbasov avatar n4to4 avatar ilya-murzinov avatar benfradet avatar mimilei avatar travisbrown-stripe avatar arron-green avatar tomjadams avatar diebauer avatar jorokr21 avatar benwhitehead avatar benjumanji avatar derrickburns avatar akozhemiakin avatar omerzach avatar crispywalrus avatar chbrown avatar bskern avatar yanana avatar jenshaase avatar magicknot avatar prayagupa avatar nicmart avatar tarossi avatar wennergr avatar rodrigopr avatar

Watchers

 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.