trait ThriftRichServer extends AnyRef
A mixin trait to provide a rich Thrift server API.
- Self Type
- ThriftRichServer with StackBasedServer[Array[Byte], Array[Byte]]
- Alphabetic
- By Inheritance
- ThriftRichServer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def params: Params
- Attributes
- protected
- abstract def serverParam: RichServerParam
- Attributes
- protected
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def maxThriftBufferSize: Int
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def serveIface(addr: SocketAddress, iface: AnyRef): ListeningServer
Serve the interface implementation
iface
, which must be generated by either Scrooge or thrift-finagle.Serve the interface implementation
iface
, which must be generated by either Scrooge or thrift-finagle.Given the IDL:
service TestService { string query(1: string x) }
Scrooge will generate an interface,
TestService.MethodPerEndpoint
, implementing the above IDL.TestService.MethodPerEndpoint
must be implemented and passed intoserveIface
:ThriftMuxRichServer .serveIface(":*", new TestService.MethodPerEndpoint { def query(x: String) = Future.value(x) // (echo service) })
Note that this interface is discovered by reflection. Passing an invalid interface implementation will result in a runtime error.
- def serveIface(addr: String, iface: AnyRef): ListeningServer
Serve the interface implementation
iface
, which must be generated by either Scrooge or thrift-finagle.Serve the interface implementation
iface
, which must be generated by either Scrooge or thrift-finagle.Given the IDL:
service TestService { string query(1: string x) }
Scrooge will generate an interface,
TestService.MethodPerEndpoint
, implementing the above IDL.TestService.MethodPerEndpoint
must be implemented and passed intoserveIface
:ThriftMuxRichServer .serveIface(":*", new TestService.MethodPerEndpoint { def query(x: String) = Future.value(x) // (echo service) })
Note that this interface is discovered by reflection. Passing an invalid interface implementation will result in a runtime error.
- def serveIfaces(addr: SocketAddress, ifaces: Map[String, AnyRef], defaultService: Option[String]): ListeningServer
Serve multiple interfaces:
Serve multiple interfaces:
val serviceMap = Map( "echo" -> new EchoService(), "extendedEcho" -> new ExtendedEchoService() ) val server = Thrift.server.serveIfaces(address, serviceMap)
A default service name can be specified, so we can upgrade an existing non-multiplexed server to a multiplexed one without breaking the old clients:
val server = Thrift.server.serveIfaces( address, serviceMap, defaultService = Some("extendedEcho"))
- def serveIfaces(addr: SocketAddress, ifaces: Map[String, AnyRef]): ListeningServer
Serve multiple interfaces:
Serve multiple interfaces:
val serviceMap = Map( "echo" -> new EchoService(), "extendedEcho" -> new ExtendedEchoService() ) val server = Thrift.server.serveIfaces(address, serviceMap)
A default service name can be specified, so we can upgrade an existing non-multiplexed server to a multiplexed one without breaking the old clients:
val server = Thrift.server.serveIfaces( address, serviceMap, defaultService = Some("extendedEcho"))
- def serveIfaces(addr: String, ifaces: Map[String, AnyRef], defaultService: Option[String] = None): ListeningServer
Serve multiple interfaces:
Serve multiple interfaces:
val serviceMap = Map( "echo" -> new EchoService(), "extendedEcho" -> new ExtendedEchoService() ) val server = Thrift.server.serveIfaces(address, serviceMap)
A default service name can be specified, so we can upgrade an existing non-multiplexed server to a multiplexed one without breaking the old clients:
val server = Thrift.server.serveIfaces( address, serviceMap, defaultService = Some("extendedEcho"))
- def serverLabel: String
- Attributes
- protected
- def serverStats: StatsReceiver
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()