Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package twitter
    Definition Classes
    com
  • package finagle
    Definition Classes
    twitter
  • 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.

    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.MethodPerEndpoint. This is then passed into ThriftMux.Client.build:

    ThriftMux.client.build[TestService.MethodPerEndpoint](
      addr, classOf[TestService.MethodPerEndpoint])

    However note that the Scala compiler can insert the latter Class for us, for which another variant of build is 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.MethodPerEndpoint must be implemented and passed into serveIface:

    // 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.

    Definition Classes
    finagle
  • Client
  • Server

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

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Server
  2. Serializable
  3. Product
  4. Equals
  5. WithCompressionPreferences
  6. OpportunisticTlsParams
  7. WithServerAdmissionControl
  8. WithServerSession
  9. WithServerTransport
  10. CommonParams
  11. ThriftRichServer
  12. StackBasedServer
  13. Transformable
  14. Parameterized
  15. Server
  16. AnyRef
  17. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Server(muxer: StackServer[Request, Response] = Server.defaultMuxer)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def configured[P](psp: (P, Param[P])): Server
    Definition Classes
    Server → Parameterized
  7. def configured[P](p: P)(implicit sp: Param[P]): Server
    Definition Classes
    Parameterized
  8. def configuredParams(newParams: Params): Server
    Definition Classes
    Parameterized
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def filtered(filter: Filter[Request, Response, Request, Response]): Server

    Prepends filter to the top of the server.

    Prepends filter to the top of the server. That is, after materializing the server (newService) filter will be the first element which requests flow through. This is a familiar chaining combinator for filters.

  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def maxThriftBufferSize: Int
    Attributes
    protected
    Definition Classes
    ThriftRichServer
  15. val muxer: StackServer[Request, Response]
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. def params: Params
    Definition Classes
    Server → ThriftRichServer → Parameterized
  20. def productElementNames: Iterator[String]
    Definition Classes
    Product
  21. def serve(addr: SocketAddress, factory: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server → Server
  22. final def serve(addr: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  23. final def serve(addr: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  24. final def serve(addr: SocketAddress, service: Service[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  25. def serveAndAnnounce(name: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  26. def serveAndAnnounce(name: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  27. def serveAndAnnounce(name: String, addr: String, service: Service[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  28. def serveAndAnnounce(name: String, addr: String, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  29. def serveAndAnnounce(name: String, addr: SocketAddress, service: Service[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  30. def serveAndAnnounce(name: String, addr: SocketAddress, service: ServiceFactory[Array[Byte], Array[Byte]]): ListeningServer
    Definition Classes
    Server
  31. def serveIface(addr: SocketAddress, iface: AnyRef): ListeningServer
    Definition Classes
    ThriftRichServer
  32. def serveIface(addr: String, iface: AnyRef): ListeningServer
    Definition Classes
    ThriftRichServer
  33. def serveIfaces(addr: SocketAddress, ifaces: Map[String, AnyRef], defaultService: Option[String]): ListeningServer
    Definition Classes
    ThriftRichServer
  34. def serveIfaces(addr: SocketAddress, ifaces: Map[String, AnyRef]): ListeningServer
    Definition Classes
    ThriftRichServer
  35. def serveIfaces(addr: String, ifaces: Map[String, AnyRef], defaultService: Option[String]): ListeningServer
    Definition Classes
    ThriftRichServer
  36. def serverLabel: String
    Attributes
    protected
    Definition Classes
    ThriftRichServer
  37. val serverParam: RichServerParam
    Attributes
    protected[twitter]
    Definition Classes
    Server → ThriftRichServer
  38. def serverStats: StatsReceiver
    Attributes
    protected
    Definition Classes
    ThriftRichServer
  39. def stack: Stack[ServiceFactory[Request, Response]]
  40. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  41. def transformed(t: Transformer): Server
    Definition Classes
    Server → Transformable
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  45. val withAdmissionControl: ServerAdmissionControlParams[Server]
    Definition Classes
    Server → WithServerAdmissionControl
  46. val withCompressionPreferences: CompressionParams[Server]
    Definition Classes
    WithCompressionPreferences
  47. def withExceptionStatsHandler(exceptionStatsHandler: ExceptionStatsHandler): Server
    Definition Classes
    Server → CommonParams
  48. def withExecutionOffloaded(pool: FuturePool): Server
    Definition Classes
    Server → CommonParams
  49. def withExecutionOffloaded(executor: ExecutorService): Server
    Definition Classes
    Server → CommonParams
  50. def withLabel(label: String): Server
    Definition Classes
    Server → CommonParams
  51. def withLabels(keywords: String*): Server
    Definition Classes
    CommonParams
  52. def withMaxReusableBufferSize(size: Int): Server

    Produce a com.twitter.finagle.ThriftMux.Server with the specified max size of the reusable buffer for thrift responses.

    Produce a com.twitter.finagle.ThriftMux.Server with the specified max size of the reusable buffer for thrift responses. If this size is exceeded, the buffer is not reused and a new buffer is allocated for the next thrift response. The default max size is 16Kb.

    size

    Max size of the reusable buffer for thrift responses in bytes.

  53. def withMonitor(monitor: Monitor): Server
    Definition Classes
    Server → CommonParams
  54. def withNoOpportunisticTls: Server
    Definition Classes
    Server → OpportunisticTlsParams
  55. def withOpportunisticTls(level: Level): Server
    Definition Classes
    Server → OpportunisticTlsParams
  56. def withParams(ps: Params): Server
    Definition Classes
    Server → Parameterized
  57. def withPerEndpointStats: Server

    Produce a com.twitter.finagle.ThriftMux.Server with per-endpoint stats filters

  58. def withProtocolFactory(pf: TProtocolFactory): Server

    Produce a com.twitter.finagle.ThriftMux.Server using the provided TProtocolFactory.

  59. def withRequestTimeout(timeout: Duration): Server
    Definition Classes
    Server → CommonParams
  60. def withRequestTimeout(timeout: Tunable[Duration]): Server
    Definition Classes
    CommonParams
  61. def withResponseClassifier(responseClassifier: ResponseClassifier): Server
    Definition Classes
    CommonParams
  62. def withServiceClass(clazz: Class[_]): Server

    Configure the service class that may be used with this server to collect instrumentation metadata.

    Configure the service class that may be used with this server to collect instrumentation metadata. This is not necessary to run a service.

    Note

    that when using the .serveIface methods this is unnecessary.

  63. val withSession: ServerSessionParams[Server]
    Definition Classes
    Server → WithServerSession
  64. def withStack(fn: (Stack[ServiceFactory[Request, Response]]) => Stack[ServiceFactory[Request, Response]]): Server
  65. def withStack(stack: Stack[ServiceFactory[Request, Response]]): Server

    Produce a com.twitter.finagle.ThriftMux.Server using the provided stack.

  66. def withStatsReceiver(statsReceiver: StatsReceiver): Server
    Definition Classes
    Server → CommonParams
  67. def withTracer(tracer: Tracer): Server
    Definition Classes
    Server → CommonParams
  68. val withTransport: ServerTransportParams[Server]
    Definition Classes
    Server → WithServerTransport

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from WithServerSession[Server]

Inherited from WithServerTransport[Server]

Inherited from CommonParams[Server]

Inherited from ThriftRichServer

Inherited from StackBasedServer[Array[Byte], Array[Byte]]

Inherited from Transformable[StackBasedServer[Array[Byte], Array[Byte]]]

Inherited from Parameterized[Server]

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

Inherited from AnyRef

Inherited from Any

Ungrouped