Package

com.twitter.inject.thrift

modules

Permalink

package modules

Visibility
  1. Public
  2. All

Type Members

  1. class ThriftClientIdModule extends TwitterModule

    Permalink

    Provides a com.twitter.finagle.thrift.ClientId binding with a value configurable via a com.twitter.app.Flag.

    Provides a com.twitter.finagle.thrift.ClientId binding with a value configurable via a com.twitter.app.Flag.

    See also

    Flags

  2. abstract class ThriftClientModule[ThriftService] extends TwitterModule with ThriftClientModuleTrait

    Permalink

    A TwitterModule allows users to configure a Finagle ThriftMux client and does NOT provide ability to filter or configure per-method Scrooge-generated interfaces.

    A TwitterModule allows users to configure a Finagle ThriftMux client and does NOT provide ability to filter or configure per-method Scrooge-generated interfaces. The client interface can be expressed as a MethodPerEndpoint or higher-kinded interface.

    Provides bindings for a Scrooge-generated MethodPerEndpoint or higher-kinded interface.

    See the ThriftMethodBuilderClientModule for building a ThriftMux client that allows for filtering and configuration per-method of the Scrooge-generated interface.

    ThriftService

    A Scrooge-generated MethodPerEndpoint or the higher-kinded type of the Scrooge-generated service, e.g., MyService[Future].

    Note

    This TwitterModule expects a com.twitter.finagle.thrift.ClientId to be bound to the object graph but does not assume how it is done. A com.twitter.finagle.thrift.ClientId can be bound by including the ThriftClientIdModule in your server configuration.

    See also

    What is ThriftMux?

    Finagle Clients

    String, label: String)

  3. abstract class ThriftMethodBuilderClientModule[ServicePerEndpoint <: Filterable[ServicePerEndpoint], MethodPerEndpoint] extends TwitterModule with ThriftClientModuleTrait

    Permalink

    A TwitterModule which allows for configuration of a ThriftMux client.

    A TwitterModule which allows for configuration of a ThriftMux client. The client interface can be expressed as a service-per-endpoint or a MethodPerEndpoint.

    Provides bindings for a Scrooge-generated service-per-endpoint and MethodPerEndpoint. The MethodPerEndpoint is constructed via the MethodPerEndpointBuilder and is thus implemented as a thin wrapper over the service-per-endpoint.

    This TwitterModule allows users to configure and filter a Scrooge-generated service-per-endpoint per-method which can then be used directly or can be wrapped by a MethodPerEndpoint.

    ServicePerEndpoint

    A Scrooge-generated ServicePerEndpoint

    MethodPerEndpoint

    A Scrooge-generated MethodPerEndpoint

    Note

    This TwitterModule expects a com.twitter.finagle.thrift.ClientId to be bound to the object graph but does not assume how it is done. A com.twitter.finagle.thrift.ClientId can be bound by including the ThriftClientIdModule in your server configuration.

    ,

    When applying filters, filter order matters. The order in which filters are applied is the order in which requests will flow through to the service and the opposite of the order in which responses return. See the ThriftMethodBuilderFactory for more information.

    See also

    What is ThriftMux?

    Finagle Clients

    ReqRepServicePerEndpoint

    ServicePerEndpoint

    MethodPerEndpoint

  4. abstract class FilteredThriftClientModule[FutureIface <: ThriftService, ServiceIface <: Filterable[ServiceIface]] extends TwitterModule with Implicits

    Permalink

    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.

    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))

    Annotations
    @deprecated
    Deprecated

    (Since version 2018-01-08) Use the com.twitter.inject.thrift.modules.ThriftMethodBuilderClientModule

    See also

    Finagle Clients

    Services-per-endpoint in Scrooge

    com.twitter.finagle.thrift.MethodIfaceBuilder

Deprecated Value Members

  1. object FilteredThriftClientFlagsModule extends TwitterModule

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2018-01-08) No replacement. Timeouts can be manipulated with Tunables

Ungrouped