Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Finagle 最新事情 #kwkni_scala

Finagle 最新事情 #kwkni_scala

Finagle 最新事情(「怖くないScala勉強会」LT 発表、2013/10/19)

http://connpass.com/event/3420/

Keyword: Scala, Netty, Finagle

Yuta Okamoto

October 19, 2013
Tweet

More Decks by Yuta Okamoto

Other Decks in Technology

Transcript

  1. Ԭຊ ༤ଠ (@okapies) Scala ؔ࿈ࢿྉͷ຋༁Λ͍͔ͭ͘΍ͬͯ·͢ “Effective Scala” (http://twitter.github.io/effectivescala/index- ja.html) “໋ྩܕͷίʔϧόοΫɺؔ਺ܕͷϓϩϛε”

    (https:// gist.github.com/okapies/5354929) "Cake Pattern: The Bakery from the Black Lagoon" (http:// okapies.hateblo.jp/entry/2013/07/15/232456) ”Scala Conference in Japan 2013” ελοϑ
  2. Netty ίϛϡχςΟͱີʹ࿈ܞͯ͠ੑೳվળ Event Object ഇࢭɻAPI ͕ v3 ͱඇޓ׵ʹ Buffer Pool

    ͰϝϞϦׂ౰ΛࣗલͰ؅ཧ 㱺 GC ස౓͕ 1/5 ʹɻϝϞϦଳҬ෯ͷফඅΛ 50% ࡟ݮɻ
  3. // Old API val cli: Service[HttpRequest, HttpResponse] = ClientBuilder() .codec(Http())

    .hosts(new InetSocketAddress(8080)) .hostConnectionLimit(1) .build() val req = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, "/") val res: Future[HttpResponse] = cli(req)
  4. // New API! val cli: Service[HttpRequest, HttpResponse] = Http.newService("localhost:8080") val

    req = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, "/") val res: Future[HttpResponse] = cli(req)