made with esnextbin
๐
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.gutefrage | |
import com.twitter.finagle._ | |
import com.twitter.finagle.http.service.HttpResponseClassifier | |
import com.twitter.server.TwitterServer | |
import com.twitter.util.Await | |
import io.finch._ | |
import io.finch.circe._ | |
import io.circe.generic.auto._ | |
import net.gutefrage.temperature.thrift._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.gutefrage | |
import com.twitter.app.App | |
import com.twitter.conversions.time._ | |
import com.twitter.finagle.{ThriftMux} | |
import com.twitter.finagle.util.DefaultTimer | |
import com.twitter.util.{Await, Future} | |
import net.gutefrage.temperature.thrift._r | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.gutefrage | |
import com.twitter.app.App | |
import com.twitter.conversions.time._ | |
import com.twitter.finagle.{ThriftMux} | |
import com.twitter.finagle.util.DefaultTimer | |
import com.twitter.util.{Await, Future} | |
import net.gutefrage.temperature.thrift._r | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.gutefrage.temperature.thrift._ | |
import com.twitter.finagle.ThriftMux | |
// this is the raw implementation with the twitter Future based API | |
val service = new TemperatureService.FutureIface { | |
override def add(datum: TemperatureDatum): Future[Unit] = ??? | |
override def mean(): Future[Double] = ??? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace * net.gutefrage.temperature.thrift | |
/** | |
* temperature in celisus and timestamp in UTC milliseconds | |
*/ | |
struct TemperatureDatum { | |
1: i32 celsius, | |
2: i64 timestamp | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.twitter.app.App | |
object MyApp extends App { | |
// parses an integer from the "-port" flag. | |
// Finagle already provides an implicit Flaggable typeclass for Int | |
// usage: -port 9000 | |
val port = flag[Int]("port", 8080, "port this server should use") | |
// parses an Env trait. See typeclass below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.twitter.app.App | |
object MyApp extends App { | |
def main() { | |
println("Hello, World") | |
} | |
} |
I hereby claim:
- I am muuki88 on github.
- I am muki (https://keybase.io/muki) on keybase.
- I have a public key whose fingerprint is ADDD 9B3B 0F47 EAD3 6D9B C1B9 59B7 C730 340E 30A7
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// API proposal # 1 | |
lazy val root = project(file(".") | |
.enablePlugins(SbtNativePackager, JavaServerArchetype) | |
.settings( | |
"maintainer" in Debian := "Your Name <[email protected]" | |
) | |
) | |
// Implementation may look like | |
object SbtNativePackager extends AutoPlugin |