com.twitter.finagle.thrift
Construct Service interface for a thrift method.
There are two ways to use a Scrooge-generated thrift service with Finagle:
1. Using a Service interface, i.e. a collection of finagle Services.
2. Using a method interface, i.e. a collection of methods returning Futures.
Example: for a thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
the Service interface is
trait LoggerServiceIface { val log: com.twitter.finagle.Service[Logger.Log.Args, Logger.Log.Result] val getLogSize: com.twitter.finagle.Service[Logger.GetLogSize.Args, Logger.GetLogSize.Result] }
and the method interface is
trait Logger[Future] { def log(message: String, logLevel: Int): Future[String] def getLogSize(): Future[Int] }
Service interfaces can be modified and composed with Finagle Filters.
Build a Service from a given Thrift method.
Construct Service interface for a thrift method.
There are two ways to use a Scrooge-generated thrift service with Finagle:
1. Using a Service interface, i.e. a collection of finagle Services.
2. Using a method interface, i.e. a collection of methods returning Futures.
Example: for a thrift service
the Service interface is
and the method interface is
Service interfaces can be modified and composed with Finagle Filters.