Package

com.twitter

finagle

Permalink

package finagle

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. finagle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. object ThriftMux extends Client[ThriftClientRequest, Array[Byte]] with Server[Array[Byte], Array[Byte]]

    Permalink

    The ThriftMux object is both a com.twitter.finagle.Client and a com.twitter.finagle.Server for the Thrift protocol served over com.twitter.finagle.mux.

    The ThriftMux object is both a com.twitter.finagle.Client and a com.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 into ThriftMux.Client.newIface:

    ThriftMux.client.newIface[TestService.FutureIface](
      addr, classOf[TestService.FutureIface])

    However note that the Scala compiler can insert the latter Class for us, for which another variant of newIface is provided:

    ThriftMux.client.newIface[TestService.FutureIface](addr)

    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 into serveIface:

    // An echo service
    ThriftMux.server.serveIface(":*", new TestService.FutureIface {
      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.

  2. package thriftmux

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped