Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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] = ???
// scrooge generates class to wrap a thrift service into a finagle compatible service definition
val finagledService = new TemperatureService.FinagledService(
service, Protocols.binaryFactory()
// run and announce the server
val server = ThriftMux.server
// static announcemnt via zookeeper
name = "zk!!/service/temperature!0",
// bind this service to this address
addr = ":8082",
// the service to announce
service = finagledService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment