com.twitter.finagle.thrift
Construct Service interface for a Thrift method.
There are two ways to use a Scrooge-generated Thrift Service with Finagle:
Service
1. Using a Service interface, i.e. a collection of Finagle Services.
Services
2. Using a method interface, i.e. a collection of methods returning Futures.
Futures
Example: for a Thrift service IDL:
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
the Service interface, or ServiceIface, is
ServiceIface
trait LoggerServiceIface { val log: com.twitter.finagle.Service[Logger.Log.Args, Logger.Log.SuccessType] val getLogSize: com.twitter.finagle.Service[Logger.GetLogSize.Args, Logger.GetLogSize.SuccessType] }
and the method interface, or MethodIface, is
MethodIface
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.
Filters
Used in conjunction with ServiceIfaceBuilder to allow for filtering of a ServiceIface.
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 IDL:
the
Service
interface, orServiceIface
, isand the method interface, or
MethodIface
, isService interfaces can be modified and composed with Finagle
Filters
.