Object

com.twitter.finagle

ThriftMux

Related Doc: package finagle

Permalink

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

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ThriftMux
  2. Server
  3. Client
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Client(muxer: StackClient[Request, Response] = Client.standardMuxer) extends StackBasedClient[ThriftClientRequest, Array[Byte]] with Parameterized[Client] with Transformable[Client] with CommonParams[Client] with ClientParams[Client] with WithClientTransport[Client] with WithClientAdmissionControl[Client] with WithClientSession[Client] with WithSessionQualifier[Client] with WithDefaultLoadBalancer[Client] with ThriftRichClient with OpportunisticTlsParams[Client] with WithCompressionPreferences[Client] with Product with Serializable

    Permalink

    A ThriftMux com.twitter.finagle.Client.

    A ThriftMux com.twitter.finagle.Client.

    See also

    Mux documentation

    Thrift documentation

    Configuration documentation

  2. final case class Server(muxer: StackServer[Request, Response] = Server.defaultMuxer) extends StackBasedServer[Array[Byte], Array[Byte]] with ThriftRichServer with Parameterized[Server] with CommonParams[Server] with WithServerTransport[Server] with WithServerSession[Server] with WithServerAdmissionControl[Server] with OpportunisticTlsParams[Server] with WithCompressionPreferences[Server] with Product with Serializable

    Permalink

    A ThriftMux com.twitter.finagle.Server.

    A ThriftMux com.twitter.finagle.Server.

    See also

    Mux documentation

    Thrift documentation

    Configuration documentation

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BaseClientStack: Stack[ServiceFactory[Request, Response]]

    Permalink

    Base com.twitter.finagle.Stack for ThriftMux clients.

  5. val BaseServerParams: Params

    Permalink

    Base com.twitter.finagle.Stack.Params for ThriftMux servers.

  6. val BaseServerStack: Stack[ServiceFactory[Request, Response]]

    Permalink

    Base com.twitter.finagle.Stack for ThriftMux servers.

  7. object Client extends ThriftClient with Serializable

    Permalink
  8. object Server extends Serializable

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def client: Client

    Permalink
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def newClient(dest: Name, label: String): ServiceFactory[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    ThriftMux → Client
  19. final def newClient(dest: String, label: String): ServiceFactory[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
  20. final def newClient(dest: String): ServiceFactory[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
  21. def newService(dest: Name, label: String): Service[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    ThriftMux → Client
  22. final def newService(dest: String, label: String): Service[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
  23. final def newService(dest: String): Service[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  26. val protocolFactory: TProtocolFactory

    Permalink
    Attributes
    protected
  27. def serve(addr: SocketAddress, factory: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    ThriftMux → Server
  28. final def serve(addr: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  29. final def serve(addr: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  30. final def serve(addr: SocketAddress, service: Service[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  31. def serveAndAnnounce(name: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  32. def serveAndAnnounce(name: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  33. def serveAndAnnounce(name: String, addr: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  34. def serveAndAnnounce(name: String, addr: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  35. def serveAndAnnounce(name: String, addr: SocketAddress, service: Service[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  36. def serveAndAnnounce(name: String, addr: SocketAddress, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

    Permalink
    Definition Classes
    Server
  37. def server: Server

    Permalink
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from finagle.Server[Array[Byte], Array[Byte]]

Inherited from AnyRef

Inherited from Any

Ungrouped