Javaで多引数のコンストラクタを避けるために使われる Builder パターンは、Scala では名前付き引数呼び出しが使えるので必要ありません。
Builderパターンに制約を加えて条件に合わない場合、コンパイルエラーにしたい。
この記事は Scala Advent Calendar 2016(Adventar) 10日目の記事です。
今は 12/10 の 625時です。年明けなんて無かった。いいね?
さてさて、sbt の依存jarのダウンロードが遅い、というのは割とよく言われる事であります。
で、この原因の一旦に、sbtが Apache Ivy を使っている、という点があります。
| Barge OS | RancherOS | Boot2Docker | |
|---|---|---|---|
| Release | 2019/06/11 | 2019/08/22 | 2019/11/14 |
| Version | 2.13.0 | 1.5.4 | 19.03.5 |
| Size | 14 MB | 130 MB | 57 MB |
| Kernel | 4.14.125 | 4.14.138 | 4.14.154 |
| User Land | Buildroot(glibc) + BusyBox v1.30.1 | Buildroot(glibc) + BusyBox v1.27.2 | Tiny Core Linux v10.1(glibc) + BusyBox v1.29.3 |
| Docker | 1.10.3 (*1) | 18.09.8 (*1) | 19.03.5 |
| Storage Driver | overlay / overlay2 (*2) | overlay2 (*3) | overlay2 (*3) |
| TLS | (*4) | ✓ | ✓ |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| package object mail { | |
| implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
| implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
| sealed abstract class MailType | |
| case object Plain extends MailType | |
| case object Rich extends MailType | |
| case object MultiPart extends MailType |
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた