帮酷LOGO

Fast, testable, Scala services built on Twitter-Server and Finagle

在 Twitter 服务器和Finagle上,构建了快速,可以测试的Scala 服务

将光标移到/点击文章中的句子上,可以查看译文。 显示原文      显示译文      双语对照    源址

  • 显示内容
文章标签:Server  Twitter  services  Finagle  SCA  服务  fast  test  
Fast, testable, Scala services built on Twitter-Server and Finagle



  • Source Code:finatra
  • WebSite:http://www.github.com/twitter/finatra
  • finatra Documents
  • finatra Download
  • Finatra

    Build StatusTest CoverageProject statusMaven CentralGitter

    Status

    This project is used in production at Twitter (and many other organizations), and is being actively developed and maintained.

    Finatra Logo

    Finatra is a lightweight framework for building fast, testable, scala applications on top of TwitterServer and Finagle.Finatra provides an easy-to-use API for creating and testingFinagle servers and apps as well as powerful JSON support, modern logging via SLF4J, Finagle client utilities, and more.

    getting involved

    Features

    Documentation

    To get started, see the getting Started section of our User Guide to get up and running.or check out the specific sections for building HTTP or Thrift servers.

    Examples

    An HTTP controller and server :

    
    
    
    
    import com.twitter.finatra.http._
    
    
    
    @Singleton
    
    
    class ExampleController extends Controller {
    
    
     get("/") { request: Request =>
    
    
     "<h1>Hello, world!</h1>"
    
    
     }
    
    
    }
    
    
    
    
    
    
    
    
    import com.twitter.finatra.http._
    
    
    
    class ExampleServer extends HttpServer {
    
    
     override def configureHttp(router: HttpRouter): Unit = {
    
    
     router
    
    
    . filter[CommonFilters]
    
    
    . add[ExampleController]
    
    
     }
    
    
    }
    
    
    
    

    A Thrift controller and server :

    
    
    
    
    import com.twitter.finatra.thrift._
    
    
    
    @Singleton
    
    
    class ExampleThriftController 
    
    
     extends Controller
    
    
     with MyThriftService.BaseServiceIface {
    
    
    
     override val myFunction = handle(MyFunction) { args: MyFunction.Args =>
    
    
    . . .
    
    
     }
    
    
    }
    
    
    
    
    
    
    
    
    import com.twitter.finatra.thrift._
    
    
    
    class ExampleServer extends ThriftServer {
    
    
     override def configureThrift(router: ThriftRouter): Unit = {
    
    
     router
    
    
    . add[ExampleThriftController]
    
    
     }
    
    
    }
    
    
    
    

    example Projects

    Finatra includes working examples which highlight various features of the framework and include tests.these examples are included in the root sbt build and are thus buildable as part of the entire project.

    Please take a look through the examples for more detailed information on features, testing, building, and running.

    Latest version

    The master branch in Github tracks the latest stable release, which is currently :

    Maven Central

    available on Maven Central. see the first Steps section in the User Guide for how to add dependencies.

    Releases are done on an approximately monthly schedule.while semver is not followed, the changelogs are detailed and include sections on public API breaks and changes in runtime behavior.

    Development version

    The develop branch in Github tracks the latest code which is updated every week.if you want to contribute a patch or fix, please use this branch as the basis of your Pull Request.

    For more information on providing contributions, please see our CONTRIBUTING.md documentation.

    Presentations

    Check out our list of presentations :Finatra Presentations.

    Authors

    A full list of contributors can be found on GitHub.

    Follow @finatra on Twitter for updates.

    License

    Copyright 2013 -2018 Twitter, Inc.

    Licensed under the Apache License, Version 2.0 :https://www.apache.org/licenses/LICENSE-2.0



    文章标签:Server  服务  test  fast  SCA  services  Scala  Twitter  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语