Provides a FutureIface in the form of RemoteService[Future] for making calls to a remote service.
Provides a FutureIface in the form of RemoteService[Future] for making calls to a remote service. The FutureIface
(e.g., RemoteService[Future]) wraps a ServiceIface in which each method is implemented in the form of a com.twitter.finagle.Service
typed from com.twitter.scrooge.ThriftMethod.Args to com.twitter.scrooge.ThriftMethod.SuccessType.
A FutureIface of RemoteService[Future] is used as this is the FutureIface type generated by Scrooge's
"services-per-endpoint" functionality e.g. the result of calling Thrift.client.newMethodIface(...); as opposed to
the functionally equivalent RemoteService.FutureIface.
Provides a FutureIface in the form of
RemoteService[Future]
for making calls to a remote service. The FutureIface (e.g., RemoteService[Future]) wraps a ServiceIface in which each method is implemented in the form of a com.twitter.finagle.Service typed from com.twitter.scrooge.ThriftMethod.Args to com.twitter.scrooge.ThriftMethod.SuccessType.A FutureIface of
RemoteService[Future]
is used as this is the FutureIface type generated by Scrooge's "services-per-endpoint" functionality e.g. the result of callingThrift.client.newMethodIface(...)
; as opposed to the functionally equivalentRemoteService.FutureIface
.To provide per-method filters to the ServiceIface provide an implementation of filterServiceIface and use the provided com.twitter.inject.thrift.filters.ThriftClientFilterBuilder to filter methods. E.g.,
serviceIface.copy( fetchBlob = filters.method(FetchBlob) .withMethodLatency .withExponentialRetry( shouldRetryResponse = PossiblyRetryableExceptions, start = 50.millis, multiplier = 2, retries = 3) .withRequestLatency .withRequestTimeout(500.millis) .withConcurrencyLimit( initialPermits = 100) .filtered(new MyFilter) .filtered[MyOtherFilter] .andThen(serviceIface.fetchBlob))
Finagle Clients
Services-per-endpoint in Scrooge
com.twitter.finagle.thrift.MethodIfaceBuilder