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

Ef45a84b10aa3cb5acd2ea0c9846bd3b?s=128

Yuta Okamoto

October 19, 2013
Tweet

Transcript

  1. Finagle ࠷৽ࣄ৘ Ԭຊ ༤ଠ (@okapies)

  2. શࠃ 100 ສਓͷ Finagle Ϣʔβͷ Έͳ͞Μʂ

  3. Ԭຊ ༤ଠ (@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” ελοϑ
  4. Apache Kafka

  5. finagle-kafka

  6. Q. Finagle ͬͯ ͍· Ͳ͏ͳͬͯΔͷʁ

  7. A. Θ͔ΒΜ

  8. ࠷৽൛: 6.7.1 Netty 4 ରԠ ৽ Client/Server API (from v6)

    ෼͔ͬͯΔ͜ͱ
  9. Netty 4 ରԠ

  10. https://blog.twitter.com/2013/netty-4-at-twitter-reduced-gc-overhead

  11. Netty ίϛϡχςΟͱີʹ࿈ܞͯ͠ੑೳվળ Event Object ഇࢭɻAPI ͕ v3 ͱඇޓ׵ʹ Buffer Pool

    ͰϝϞϦׂ౰ΛࣗલͰ؅ཧ 㱺 GC ස౓͕ 1/5 ʹɻϝϞϦଳҬ෯ͷফඅΛ 50% ࡟ݮɻ
  12. Finagle on Netty 4?

  13. ࠷ۙ Netty 3 ͔Βͷ decouple Λ΍ͬͨ ࢼͯ͠Έ͍ͨͳΒ DefaultClient ͱ DefaultServer

    ݟΕ
  14. ৽ Client/Server API

  15. v6 ϦϦʔε͔࣌Βਫ໘ԼͰίπίπ΍ͬͯͨͬΆ͍ ·ͩਖ਼ࣜʹ͸ެ։͞Εͯͳ͍͕ɺ΋͏৮ΕΔঢ়ଶ API ͸·ͩ·ͩྲྀಈతʁ

  16. // 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)
  17. // 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)
  18. ϩʔυόϥϯε΍ίωΫγϣϯϓʔϧΛ࣮૷ࡁ Codec ͷࢦఆ͸͜ͷ΁Μ

  19. Client ʹ mix-in ͢Δ Richʢ͜Θ͘ͳ͍ʣAPI Λఏڙ

  20. http://twitter.github.io/finagle/guide/

  21. Thanks!