Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
Create a new client of type ThriftServiceType
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$MethodPerEndpoint
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
The client name used when group isn't named.
The client name used when group isn't named.
Build client interfaces for multiplexed thrift services.
Build client interfaces for multiplexed thrift services.
E.g.
val client = Thrift.client.multiplex(address, "client") { client => new { val echo = client.newIface[Echo.FutureIface]("echo") val extendedEcho = client.newServiceIface[ExtendedEcho.ServiceIface]("extendedEcho") } } client.echo.echo("hello") client.extendedEcho.getStatus(ExtendedEcho.GetStatus.Args())
Build client interfaces for multiplexed thrift services.
Build client interfaces for multiplexed thrift services.
E.g.
val client = Thrift.client.multiplex(address, "client") { client => new { val echo = client.newIface[Echo.FutureIface]("echo") val extendedEcho = client.newServiceIface[ExtendedEcho.ServiceIface]("extendedEcho") } } client.echo.echo("hello") client.extendedEcho.getStatus(ExtendedEcho.GetStatus.Args())
The Stack.Params
to be used by this client.
The Stack.Params
to be used by this client.
Both defaultClientName and stats predate Stack.Params and as such are implemented separately.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method:
val loggerService: Logger.ServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ServicePerEndpoint]("localhost:8000", "client_label") val response: String = loggerService.log(Logger.Log.Args("log message", 1))
You can also create a Finagle Service[scrooge.Request, scrooge.Response]
per-endpoint (method)
for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method that uses the Scrooge Request/Response envelopes:
val loggerService: Logger.ReqRepServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ReqRepServicePerEndpoint]("localhost:8000", "client_label") val response: c.t.scrooge.Response[String] = loggerService.log(c.t.scrooge.Request(Logger.Log.Args("log message", 1)))
This allows you to access any contained c.t.scrooge.Request
and c.t.scrooge.Response
headers.
Address of the service to connect to.
Assign a label for scoped stats.
The builder type is generated by Scrooge for a thrift service.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method:
val loggerService: Logger.ServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ServicePerEndpoint]("localhost:8000", "client_label") val response: String = loggerService.log(Logger.Log.Args("log message", 1))
You can also create a Finagle Service[scrooge.Request, scrooge.Response]
per-endpoint (method)
for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method that uses the Scrooge Request/Response envelopes:
val loggerService: Logger.ReqRepServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ReqRepServicePerEndpoint]("localhost:8000", "client_label") val response: c.t.scrooge.Response[String] = loggerService.log(c.t.scrooge.Request(Logger.Log.Args("log message", 1)))
This allows you to access any contained c.t.scrooge.Request
and c.t.scrooge.Response
headers.
Address of the service to connect to, in the format accepted by Resolver.eval
.
Assign a label for scoped stats.
The builder type is generated by Scrooge for a thrift service.
Use a buffered transport instead of the default framed transport.
Use a buffered transport instead of the default framed transport. In almost all cases, the default framed transport should be used.
Produce a com.twitter.finagle.Thrift.Client with the specified max size of the reusable buffer for thrift responses.
Produce a com.twitter.finagle.Thrift.Client 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.Client with per-endpoint stats filters
(Since version 2017-8-16) Use com.twitter.finagle.thrift.RichClientParam
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Create a new client of type Iface
, which must be generated
by Scrooge.
Create a new client of type Iface
, which must be generated
by Scrooge.
For Scala generated code, the Class
passed in should be
either ServiceName$FutureIface
or ServiceName[Future]
.
For Java generated code, the Class
passed in should be
ServiceName$ServiceIface
.
(Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method:
val loggerService: Logger.ServiceIface = Thrift.client.newServiceIface[Logger.ServiceIface]("localhost:8000", "client_label") val response: String = loggerService.log(Logger.Log.Args("log message", 1))
Address of the service to connect to.
Assign a label for scoped stats.
The builder type is generated by Scrooge for a thrift service.
(Since version 2017-11-13) Use com.twitter.finagle.ThriftRichClient#servicePerEndpoint[ServicePerEndpoint]
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
Construct a Finagle Service
interface for a Scrooge-generated Thrift object.
E.g. given a Thrift service
service Logger { string log(1: string message, 2: i32 logLevel); i32 getLogSize(); }
you can construct a client interface with a Finagle Service per Thrift method:
val loggerService: Logger.ServiceIface = Thrift.client.newServiceIface[Logger.ServiceIface]("localhost:8000", "client_label") val response: String = loggerService.log(Logger.Log.Args("log message", 1))
Address of the service to connect to, in the format accepted by Resolver.eval
.
Assign a label for scoped stats.
The builder type is generated by Scrooge for a thrift service.
(Since version 2017-11-13) Use com.twitter.finagle.ThriftRichClient#servicePerEndpoint[ServicePerEndpoint]
(Since version 2018-10-30) Use withStack(Stack[ServiceFactory[Req, Rep]] => Stack[ServiceFactory[Req, Rep]]) instead
A ThriftMux
com.twitter.finagle.Client
.Mux documentation
Thrift documentation
Configuration documentation