A ThriftMux com.twitter.finagle.Client
.
A ThriftMux com.twitter.finagle.Client
.
Mux documentation
Thrift documentation
Configuration documentation
A ThriftMux com.twitter.finagle.Server
.
A ThriftMux com.twitter.finagle.Server
.
Mux documentation
Thrift documentation
Configuration documentation
Base com.twitter.finagle.Stack for ThriftMux clients.
Base com.twitter.finagle.Stack.Params for ThriftMux servers.
Base com.twitter.finagle.Stack for ThriftMux servers.
The
ThriftMux
object is both acom.twitter.finagle.Client
and acom.twitter.finagle.Server
for the Thrift protocol served over com.twitter.finagle.mux. Rich interfaces are provided to adhere to those generated from a Thrift IDL by Scrooge or thrift-finagle.Clients
Clients can be created directly from an interface generated from a Thrift IDL:
For example, this IDL:
service TestService { string query(1: string x) }
compiled with Scrooge, generates the interface
TestService.FutureIface
. This is then passed intoThriftMux.Client.newIface
:However note that the Scala compiler can insert the latter
Class
for us, for which another variant ofnewIface
is provided:In Java, we need to provide the class object:
TestService.FutureIface client = ThriftMux.client.newIface(addr, TestService.FutureIface.class);
Servers
Servers are also simple to expose:
TestService.FutureIface
must be implemented and passed intoserveIface
:This object does not expose any configuration options. Both clients and servers are instantiated with sane defaults. Clients are labeled with the "clnt/thrift" prefix and servers with "srv/thrift". If you'd like more configuration, see the configuration documentation.