A copy constructor in lieu of defining StackClient as a case class.
A copy constructor in lieu of defining StackClient as a case class.
Defines the service factory, which establishes connections to a remote peer on apply and returns a service which can write messages onto the wire and read them off of the wire.
Defines the service factory, which establishes connections to a remote peer on apply and returns a service which can write messages onto the wire and read them off of the wire.
Concrete StackClient implementations are expected to specify this.
The current parameter map.
The current parameter map.
The current stack.
The current stack.
Creates a new StackClient with parameter psp._1
and Stack Param type psp._2
.
Creates a new StackClient with parameter psp._1
and Stack Param type psp._2
.
Creates a new StackClient with parameter p
.
Creates a new StackClient with parameter p
.
Creates a new StackClient with additional parameters newParams
.
Creates a new StackClient with additional parameters newParams
.
Prepends filter
to the top of the client.
Prepends filter
to the top of the client. That is, after materializing
the client (newClient/newService) filter
will be the first element which
requests flow through. This is a familiar chaining combinator for filters and
is particularly useful for StdStackClient
implementations that don't expose
services but instead wrap the resulting service with a rich API.
Create a new client connected to dest
.
Create a new client connected to dest
.
See the user guide
for details on destination names.
Argument label
is used to assign a label to this client.
The label is used to display stats, etc.
if an empty String is provided, then the label
from the Label Stack.Params is used.
If that is also an empty String, then dest
is used.
Create a new client connected to dest
.
Create a new client connected to dest
.
See the user guide
for details on destination names.
Argument label
is used to assign a label to this client.
The label is used to display stats, etc.
Create a new client connected to dest
.
Create a new client connected to dest
.
See the user guide
for details on destination names.
Create a new service which dispatches requests to dest
.
Create a new service which dispatches requests to dest
.
See the user guide
for details on destination names.
Argument label
is used to assign a label to this client.
The label is used to display stats, etc.
Create a new service which dispatches requests to dest
.
Create a new service which dispatches requests to dest
.
See the user guide
for details on destination names.
Create a new service which dispatches requests to dest
.
Create a new service which dispatches requests to dest
.
See the user guide
for details on destination names.
Creates a new StackClient with f
applied to stack
.
Creates a new StackClient with f
applied to stack
.
For expert users only.
Transform the stack using the given Transformer
.
Transform the stack using the given Transformer
.
An entry point for configuring the clients' admission control
An entry point for configuring the clients' admission control
Configures this server or client with given exception stats handler.
Configures this server or client with given exception stats handler.
Configures this server or client with given label
(default: empty string).
Configures this server or client with given label
(default: empty string).
The label
value is used for stats reporting to scope stats reported
from different clients/servers to a single stats receiver.
Configures this server or client with given util.Monitor (default: com.twitter.finagle.util.DefaultMonitor).
Configures this server or client with given util.Monitor (default: com.twitter.finagle.util.DefaultMonitor).
Creates a new StackClient with params
used to configure this StackClient's stack
.
Creates a new StackClient with params
used to configure this StackClient's stack
.
Configures the request timeout
of this server or client (default: unbounded).
Configures the request timeout
of this server or client (default: unbounded).
If the request has not completed within the given timeout
, the pending
work will be interrupted via com.twitter.util.Future.raise.
The client request timeout is the maximum amount of time given to a single request (if there are retries, they each get a fresh request timeout). The timeout is applied only after a connection has been acquired. That is: it is applied to the interval between the dispatch of the request and the receipt of the response.
The server request timeout is the maximum amount of time, a server is allowed to spend handling the incoming request. Using the Finagle terminology, this is an amount of time after which a non-satisfied future returned from the user-defined service times out.
https://twitter.github.io/finagle/guide/Clients.html#timeouts-expiration
Configure a com.twitter.finagle.service.ResponseClassifier which is used to determine the result of a request/response.
Configure a com.twitter.finagle.service.ResponseClassifier which is used to determine the result of a request/response.
This allows developers to give Finagle the additional application-specific knowledge necessary in order to properly classify responses. Without this, Finagle cannot make judgements about application-level failures as it only has a narrow understanding of failures (for example: transport level, timeouts, and nacks).
As an example take an HTTP server that returns a response with a 500 status code. To Finagle this is a successful request/response. However, the application developer may want to treat all 500 status codes as failures and can do so via setting a com.twitter.finagle.service.ResponseClassifier.
ResponseClassifier is a PartialFunction and as such multiple classifiers can be composed together via PartialFunction.orElse.
Response classification is independently configured on the client and server.
For client-side response classification using com.twitter.finagle.builder.ClientBuilder,
see com.twitter.finagle.builder.ClientBuilder.responseClassifier
If unspecified, the default classifier is com.twitter.finagle.service.ResponseClassifier.Default which is a total function fully covering the input domain.
com.twitter.finagle.http.service.HttpResponseClassifier
for some
HTTP classification tools.
Configures the requeue backoff policy of this client (default: no delay).
Configures the requeue backoff policy of this client (default: no delay).
The backoff
policy is represented by a stream of delays (i.e.,
Stream[Duration]
) used to delay each retry.
https://twitter.github.io/finagle/guide/Clients.html#retries
Configures the retry budget of this client (default: allows for about 20% of the total requests to be retried on top of 10 retries per second).
Configures the retry budget of this client (default: allows for about 20% of the total requests to be retried on top of 10 retries per second).
This budget
is shared across requests and governs the number of
retries that can be made by this client.
The retry budget helps prevent clients from overwhelming the downstream service.
https://twitter.github.io/finagle/guide/Clients.html#retries
An entry point for configuring the client's session.
An entry point for configuring the client's session.
An entry point for configuring the client's session qualifiers (e.g.
An entry point for configuring the client's session qualifiers (e.g. circuit breakers).
https://twitter.github.io/finagle/guide/Clients.html#circuit-breaking
A new StackClient with the provided stack.
A new StackClient with the provided stack.
Configures this server or client with given stats.StatsReceiver (default: stats.DefaultStatsReceiver).
Configures this server or client with given stats.StatsReceiver (default: stats.DefaultStatsReceiver).
Configures this server or client with given tracing.Tracer (default: com.twitter.finagle.tracing.DefaultTracer).
Configures this server or client with given tracing.Tracer (default: com.twitter.finagle.tracing.DefaultTracer).
An entry point for configuring the client's com.twitter.finagle.transport.Transport.
An entry point for configuring the client's com.twitter.finagle.transport.Transport.
Transport
is a Finagle abstraction over the network connection (i.e., a TCP connection).
The standard template implementation for com.twitter.finagle.client.StackClient.
StackClient.newStack for the default modules used by Finagle clients.
The user guide for further details on Finagle clients and their configuration.