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.FutureIface
,
implementing the above IDL.
TestService.FutureIface
must be implemented and passed
into serveIface
:
ThriftMuxRichServer .serveIface(":*", new TestService.FutureIface { 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.
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.FutureIface
,
implementing the above IDL.
TestService.FutureIface
must be implemented and passed
into serveIface
:
ThriftMuxRichServer .serveIface(":*", new TestService.FutureIface { 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.
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"))
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"))
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"))
Produce a com.twitter.finagle.Thrift.Server with the specified max size of the reusable buffer for thrift responses.
Produce a com.twitter.finagle.Thrift.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.
Max size of the reusable buffer for thrift responses in bytes.
Produce a com.twitter.finagle.Thrift.Server with per-endpoint stats filters
A ThriftMux
com.twitter.finagle.Server
.Thrift documentation
Configuration documentation