• Stars
    star
    1,597
  • Rank 29,298 (Top 0.6 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scala combinator library for building Finagle HTTP services

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

Scala CI 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]"
)

Hello World!

This "Hello World!" example is built with just finch-core:

import cats.effect.{IO, IOApp}
import io.finch._

object Main extends IOApp.Simple with Endpoint.Module[IO] {
  override def run: IO[Unit] = {
    val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
    Bootstrap[IO].serve[Text.Plain](api).listen(":8080").useForever
  }
}

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.

More Repositories

1

finagle-clojure

A thin Clojure wrapper around Finagle
Clojure
148
star
2

featherbed

Asynchronous Scala HTTP client using Finagle, Shapeless and Cats
Scala
137
star
3

finagle-oauth2

OAuth2 Server-Side Provider for Finagle
Scala
85
star
4

finagle-postgres

PostgreSQL protocol support for Finagle
Scala
81
star
5

finagle-serial

Create Finagle servers and clients that use the serialization library of your choice!
Scala
62
star
6

roc

A Modern Finagle-Postgresql Client
Scala
55
star
7

finagle-zookeeper

Native non-blocking client for ZooKeeper with Finagle
Scala
55
star
8

finagle-websocket

Finagle Websocket clients and servers
Scala
35
star
9

finagle-example-name-finder

A Finagle example: Named-entity recognition
Scala
25
star
10

finagle-smtp

Finagle SMTP client
Scala
15
star
11

finagle-protobuf

Protobuf support for Finagle
Scala
14
star
12

webbing

Route combinators and other utilities for writing web services on Finagle
Scala
11
star
13

finagle-mysql-shapes

Finagle MySQL type classes for row and column decoding
Scala
11
star
14

finagle-irc

Finagle IRC clients and servers
Scala
10
star
15

finch-petstore

A Finch application implementing the Swagger Petstore demo
Scala
10
star
16

finagle-http-auth

HTTP Basic Auth for finagle-http
Scala
8
star
17

finatra-kafka

Easily build & test Kafka Streams applications on top of a TwitterServer with Finatra
Scala
6
star
18

finagle-swift

Scala
5
star
19

finagle.github.io

Finagle blog
HTML
4
star
20

finatra-petstore

A Petstore API example for Finatra!
2
star
21

finagle-stream

A retired project finagle/finagle-stream (neither actively used nor maintained)
Scala
1
star