package finagle
- Alphabetic
- By Inheritance
- finagle
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- object ThriftMux extends Client[ThriftClientRequest, Array[Byte]] with Server[Array[Byte], Array[Byte]]
The
ThriftMuxobject is both acom.twitter.finagle.Clientand acom.twitter.finagle.Serverfor the Thrift protocol served over com.twitter.finagle.mux.The
ThriftMuxobject is both acom.twitter.finagle.Clientand acom.twitter.finagle.Serverfor 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.MethodPerEndpoint. This is then passed intoThriftMux.Client.build:ThriftMux.client.build[TestService.MethodPerEndpoint]( addr, classOf[TestService.MethodPerEndpoint])
However note that the Scala compiler can insert the latter
Classfor us, for which another variant ofbuildis provided:ThriftMux.client.build[TestService.MethodPerEndpoint](addr)
In Java, we need to provide the class object:
TestService.MethodPerEndpoint client = ThriftMux.client.build(addr, TestService.MethodPerEndpoint.class);Servers
Servers are also simple to expose:
TestService.MethodPerEndpointmust be implemented and passed intoserveIface:// An echo service ThriftMux.server.serveIface(":*", new TestService.MethodPerEndpoint { def query(x: String): Future[String] = Future.value(x) })
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.