Object

com.twitter.finagle

ThriftMux

Related Doc: package finagle

Permalink

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

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 can be created directly from an interface generated from a Thrift IDL:

$clientExample

Servers are also simple to expose:

$serverExample

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 com.twitter.finagle.ThriftMux.Server and com.twitter.finagle.ThriftMux.Client classes.

Linear Supertypes
ThriftRichServer, finagle.Server[Array[Byte], Array[Byte]], ThriftRichClient, finagle.Client[ThriftClientRequest, Array[Byte]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ThriftMux
  2. ThriftRichServer
  3. Server
  4. ThriftRichClient
  5. Client
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class Client(muxer: StackClient[Request, Response] = ...) extends StackBasedClient[ThriftClientRequest, Array[Byte]] with Parameterized[Client] with Transformable[Client] with ThriftRichClient with Product with Serializable

    Permalink
  2. case class Server(muxer: StackServer[Request, Response] = serverMuxer) extends StackBasedServer[Array[Byte], Array[Byte]] with ThriftRichServer with Parameterized[Server] with Product with Serializable

    Permalink
  3. case class ServerMuxer(stack: Stack[ServiceFactory[Request, Response]] = BaseServerStack, params: Params = ...) extends StdStackServer[Request, Response, ServerMuxer] with Product with Serializable

    Permalink

    A server for the Thrift protocol served over com.twitter.finagle.mux.

    A server for the Thrift protocol served over com.twitter.finagle.mux. ThriftMuxServer is backwards-compatible with Thrift clients that use the framed transport and binary protocol. It switches to the backward-compatible mode when the first request is not recognized as a valid Mux message but can be successfully handled by the underlying Thrift service. Since a Thrift message that is encoded with the binary protocol starts with a header value of 0x800100xx, Mux does not confuse it with a valid Mux message (0x80 = -128 is an invalid Mux message type) and the server can reliably detect the non-Mux Thrift client and switch to the backwards-compatible mode.

    Note that the server is also compatible with non-Mux finagle-thrift clients. It correctly responds to the protocol up-negotiation request and passes the tracing information embedded in the thrift requests to Mux (which has native tracing support).

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. object Server extends Serializable

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val client: Client

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. lazy val defaultClientName: String

    Permalink
    Attributes
    protected
    Definition Classes
    ThriftMux → ThriftRichClient
  9. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. val maxThriftBufferSize: Int

    Permalink
    Definition Classes
    ThriftRichServer
  16. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    Client
  20. def newIface[Iface](name: Name, label: String, cls: Class[_]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  21. def newIface[Iface](dest: Name, label: String)(implicit arg0: ClassTag[Iface]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  22. def newIface[Iface](dest: String, label: String)(implicit arg0: ClassTag[Iface]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  23. def newIface[Iface](dest: String)(implicit arg0: ClassTag[Iface]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  24. def newIface[Iface](dest: String, label: String, cls: Class[_]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  25. def newIface[Iface](dest: String, cls: Class[_]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
  26. def newMethodIface[ServiceIface, FutureIface](serviceIface: ServiceIface)(implicit builder: MethodIfaceBuilder[ServiceIface, FutureIface]): FutureIface

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

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

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

    Permalink
    Definition Classes
    Client
  30. def newServiceIface[ServiceIface](dest: Name, label: String)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface

    Permalink
    Definition Classes
    ThriftRichClient
  31. def newServiceIface[ServiceIface](dest: String, label: String)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface

    Permalink
    Definition Classes
    ThriftRichClient
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. val protocolFactory: TProtocolFactory

    Permalink
    Attributes
    protected
    Definition Classes
    ThriftMux → ThriftRichServer → ThriftRichClient
  35. def serve(addr: SocketAddress, factory: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Server
  45. def serveIface(addr: SocketAddress, iface: AnyRef): ListeningServer

    Permalink
    Definition Classes
    ThriftRichServer
  46. def serveIface(addr: String, iface: AnyRef): ListeningServer

    Permalink
    Definition Classes
    ThriftRichServer
  47. val server: Server

    Permalink
  48. val serverLabel: String

    Permalink
    Attributes
    protected
    Definition Classes
    ThriftRichServer
  49. val serverMuxer: ServerMuxer

    Permalink
  50. lazy val serverStats: StatsReceiver

    Permalink
    Attributes
    protected
    Definition Classes
    ThriftRichServer
  51. lazy val stats: StatsReceiver

    Permalink
    Attributes
    protected
    Definition Classes
    ThriftMux → ThriftRichClient
  52. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  54. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long, arg1: Int): Unit

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

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

Deprecated Value Members

  1. final def newClient(dest: Group[SocketAddress]): ServiceFactory[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
    Annotations
    @deprecated
    Deprecated

    (Since version 6.7.x) Use destination names

  2. def newIface[Iface](group: Group[SocketAddress], cls: Class[_]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 6.7.x) Use destination names via newIface(String) or newIface(Name)

  3. def newIface[Iface](group: Group[SocketAddress])(implicit arg0: ClassTag[Iface]): Iface

    Permalink
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 6.7.x) Use destination names via newIface(String) or newIface(Name)

  4. final def newService(dest: Group[SocketAddress]): Service[ThriftClientRequest, Array[Byte]]

    Permalink
    Definition Classes
    Client
    Annotations
    @deprecated
    Deprecated

    (Since version 6.7.x) Use destination names

  5. def newServiceIface[ServiceIface](dest: Name)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface

    Permalink
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2015-10-26) Must provide service label

  6. def newServiceIface[ServiceIface](dest: String)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface

    Permalink
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2015-10-26) Must provide service label

  7. def withClientId(clientId: ClientId): Client

    Permalink

    Produce a com.twitter.finagle.ThriftMux.Client using the provided client ID.

    Produce a com.twitter.finagle.ThriftMux.Client using the provided client ID.

    Annotations
    @deprecated
    Deprecated

    (Since version 6.22.0) Use ThriftMux.client.withClientId

  8. def withProtocolFactory(pf: TProtocolFactory): Client

    Permalink

    Produce a com.twitter.finagle.ThriftMux.Client using the provided protocolFactory.

    Produce a com.twitter.finagle.ThriftMux.Client using the provided protocolFactory.

    Annotations
    @deprecated
    Deprecated

    (Since version 6.22.0) Use ThriftMux.client.withProtocolFactory

Inherited from ThriftRichServer

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

Inherited from ThriftRichClient

Inherited from finagle.Client[ThriftClientRequest, Array[Byte]]

Inherited from AnyRef

Inherited from Any

Ungrouped