case class Client(stack: Stack[ServiceFactory[Request, Result]] = Client.stack, params: Params = Client.params) extends StdStackClient[Request, Result, Client] with WithSessionPool[Client] with WithDefaultLoadBalancer[Client] with MysqlRichClient with Product with Serializable
Implements a mysql client in terms of a com.twitter.finagle.client.StackClient. The client inherits a wealth of features from finagle including connection pooling and load balancing.
Additionally, this class provides methods via MysqlRichClient for constructing a client which exposes an API that has use case specific methods, for example mysql.Client.read, mysql.Client.modify, and mysql.Client.prepare. This is an easier experience for most users.
import com.twitter.finagle.Mysql import com.twitter.finagle.mysql.Client import com.twitter.util.Future val client: Client = Mysql.client .withCredentials("username", "password") .withDatabase("database") .newRichClient("host:port") val names: Future[Seq[String]] = client.select("SELECT name FROM employee") { row => row.stringOrNull("name") }
- Alphabetic
- By Inheritance
- Client
- Serializable
- Product
- Equals
- MysqlRichClient
- WithDefaultLoadBalancer
- WithSessionPool
- StdStackClient
- EndpointerStackClient
- WithSessionQualifier
- WithClientSession
- WithClientTransport
- WithClientAdmissionControl
- ClientParams
- CommonParams
- StackClient
- StackBasedClient
- Transformable
- Parameterized
- Client
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Client(stack: Stack[ServiceFactory[Request, Result]] = Client.stack, params: Params = Client.params)
Type Members
- type Context = TransportContext
The type of the transport's context.
The type of the transport's context.
- Attributes
- protected
- Definition Classes
- Client → StdStackClient
- type In = Packet
The type we write into the transport.
The type we write into the transport.
- Attributes
- protected
- Definition Classes
- Client → StdStackClient
- type Out = Packet
The type we read out of the transport.
The type we read out of the transport.
- Attributes
- protected
- Definition Classes
- Client → StdStackClient
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def configured[P](psp: (P, Param[P])): Client
Creates a new StackClient with parameter
psp._1
and Stack Param typepsp._2
.Creates a new StackClient with parameter
psp._1
and Stack Param typepsp._2
.- Definition Classes
- Client → EndpointerStackClient → StackClient → Parameterized
- def configured[P](p: P)(implicit arg0: Param[P]): Client
Creates a new StackClient with parameter
p
.Creates a new StackClient with parameter
p
.- Definition Classes
- EndpointerStackClient → StackClient → Parameterized
- def configuredParams(newParams: Params): Client
Creates a new StackClient with additional parameters
newParams
.Creates a new StackClient with additional parameters
newParams
.- Definition Classes
- EndpointerStackClient → StackClient → Parameterized
- def copy1(stack: Stack[ServiceFactory[Request, Result]] = this.stack, params: Params = this.params): Client
A copy constructor in lieu of defining StackClient as a case class.
A copy constructor in lieu of defining StackClient as a case class.
- Attributes
- protected
- Definition Classes
- Client → StdStackClient → EndpointerStackClient
- final def endpointer: Stackable[ServiceFactory[Request, Result]]
A stackable module that creates new
Transports
(via transporter) when applied.A stackable module that creates new
Transports
(via transporter) when applied.- Attributes
- protected
- Definition Classes
- StdStackClient → EndpointerStackClient
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def filtered(filter: Filter[Request, Result, Request, Result]): Client
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 forStdStackClient
implementations that don't expose services but instead wrap the resulting service with a rich API.- Definition Classes
- Client → EndpointerStackClient
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def injectors: Seq[ClientParamsInjector]
- Attributes
- protected
- Definition Classes
- EndpointerStackClient
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newClient(dest: Name, label0: String): ServiceFactory[Request, Result]
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.- label0
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.
- Definition Classes
- EndpointerStackClient → Client
- final def newClient(dest: String, label: String): ServiceFactory[Request, Result]
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.- Definition Classes
- Client
- final def newClient(dest: String): ServiceFactory[Request, Result]
Create a new client connected to
dest
.Create a new client connected to
dest
. See the user guide for details on destination names.- Definition Classes
- Client
- def newDispatcher(transport: Transport[In, Out] { type Context <: Client.this.Context }): Service[Request, Result]
Defines a dispatcher, a function which reconciles the stream based
Transport
with a Request/Response orientedService
.Defines a dispatcher, a function which reconciles the stream based
Transport
with a Request/Response orientedService
. Together with aTransporter
, it forms the foundation of a finagle client. Concrete implementations are expected to specify this.- Attributes
- protected
- Definition Classes
- Client → StdStackClient
- See also
- def newRichClient(dest: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
.Creates a new
RichClient
connected to the logical destination described bydest
.- dest
the location to connect to, e.g. "host:port". See the user guide for details on destination names.
- Definition Classes
- MysqlRichClient
- def newRichClient(dest: String, label: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
.Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
. Thelabel
is used to scope client stats.- Definition Classes
- MysqlRichClient
- def newRichClient(dest: Name, label: String): mysql.Client with Transactions
Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
.Creates a new
RichClient
connected to the logical destination described bydest
with the assignedlabel
. Thelabel
is used to scope client stats.- Definition Classes
- MysqlRichClient
- def newService(dest: Name, label: String): Service[Request, Result]
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.- Definition Classes
- EndpointerStackClient → Client
- final def newService(dest: String, label: String): Service[Request, Result]
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.- Definition Classes
- Client
- final def newService(dest: String): Service[Request, Result]
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.- Definition Classes
- Client
- def newTransporter(addr: SocketAddress): Transporter[In, Out, Context]
Defines a typed com.twitter.finagle.client.Transporter for this client.
Defines a typed com.twitter.finagle.client.Transporter for this client. Concrete StackClient implementations are expected to specify this.
- Attributes
- protected
- Definition Classes
- Client → StdStackClient
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val params: Params
The current parameter map.
The current parameter map.
- Definition Classes
- Client → StackClient → Parameterized
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def registerTransporter(transporterName: String): Unit
Export info about the transporter type so that we can query info about its implementation at runtime.
Export info about the transporter type so that we can query info about its implementation at runtime.
- Attributes
- protected
- Definition Classes
- StackClient
- def richClientStatsReceiver: StatsReceiver
- Definition Classes
- Client → MysqlRichClient
- val stack: Stack[ServiceFactory[Request, Result]]
The current stack.
The current stack.
- Definition Classes
- Client → StackClient
- val supportUnsigned: Boolean
Whether the client supports unsigned integer fields
Whether the client supports unsigned integer fields
- Attributes
- protected
- Definition Classes
- Client → MysqlRichClient
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def transformed(t: Transformer): StackClient[Request, Result]
- Definition Classes
- StackClient → Transformable
- See also
- def transformers: Seq[ClientStackTransformer]
- Attributes
- protected
- Definition Classes
- EndpointerStackClient
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val withAdmissionControl: ClientAdmissionControlParams[Client]
An entry point for configuring the clients' admission control
An entry point for configuring the clients' admission control
- Definition Classes
- Client → WithClientAdmissionControl
- def withAffectedRows(): Client
Don't set the CLIENT_FOUND_ROWS flag when establishing a new session.
Don't set the CLIENT_FOUND_ROWS flag when establishing a new session. This will make "INSERT ... ON DUPLICATE KEY UPDATE" statements return the "correct" update count.
See https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_row-count
- def withCachingSha2Password: Client
To enable the client to use the
caching_sha2_password
authentication method. - def withCharset(charset: Short): Client
The default character set used when establishing a new session.
- def withConnectionInitRequest(request: Request): Client
The connection init request to use when establishing a new session.
- def withCredentials(u: String, p: String): Client
The credentials to use when authenticating a new session.
The credentials to use when authenticating a new session.
- p
if
null
, no password is used.
- def withDatabase(db: String): Client
Database to use when this client establishes a new session.
- def withExceptionStatsHandler(exceptionStatsHandler: ExceptionStatsHandler): Client
Configures this server or client with given exception stats handler.
Configures this server or client with given exception stats handler.
- Definition Classes
- Client → CommonParams
- def withExecutionOffloaded(pool: FuturePool): Client
Configures this server or client to shift user-defined computation (com.twitter.util.Future callbacks and transformations) off of IO threads into a given FuturePool.
Configures this server or client to shift user-defined computation (com.twitter.util.Future callbacks and transformations) off of IO threads into a given FuturePool.
By default, Finagle executes all futures in the IO threads, minimizing context switches. Given there is usually a fixed number of IO threads shared across a JVM process, it's critically important to ensure they aren't being blocked by the application code, affecting system's responsiveness. Shifting application-level work onto a dedicated FuturePool or ExecutorService offloads IO threads, which may improve throughput in CPU-bound systems.
As always, run your own tests before enabling this feature.
- Definition Classes
- Client → CommonParams
- def withExecutionOffloaded(executor: ExecutorService): Client
Configures this server or client to shift user-defined computation (com.twitter.util.Future callbacks and transformations) off of IO threads into a given ExecutorService.
Configures this server or client to shift user-defined computation (com.twitter.util.Future callbacks and transformations) off of IO threads into a given ExecutorService.
By default, Finagle executes all futures in the IO threads, minimizing context switches. Given there is usually a fixed number of IO threads shared across a JVM process, it's critically important to ensure they aren't being blocked by the application code, affecting system's responsiveness. Shifting application-level work onto a dedicated FuturePool or ExecutorService offloads IO threads, which may improve throughput in CPU-bound systems.
As always, run your own tests before enabling this feature.
- Definition Classes
- Client → CommonParams
- def withLabel(label: String): Client
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.- Definition Classes
- Client → CommonParams
- def withLabels(keywords: String*): Client
- Definition Classes
- CommonParams
- val withLoadBalancer: DefaultLoadBalancingParams[Client]
An entry point for configuring the client's load balancer that implements a strategy for choosing one host/node from a replica set to service a request.
An entry point for configuring the client's load balancer that implements a strategy for choosing one host/node from a replica set to service a request.
The default setup for a Finagle client is to use power of two choices algorithm to distribute load across endpoints, and comparing nodes via a least loaded metric.
- Definition Classes
- Client → WithDefaultLoadBalancer
- See also
https://twitter.github.io/finagle/guide/Clients.html#load-balancing
- def withMaxConcurrentPrepareStatements(num: Int): Client
The maximum number of concurrent prepare statements.
- def withMonitor(monitor: Monitor): Client
Configures this server or client with given util.Monitor (default: com.twitter.finagle.util.NullMonitor).
Configures this server or client with given util.Monitor (default: com.twitter.finagle.util.NullMonitor).
Monitors are Finagle's out-of-band exception reporters. Whenever an exception is thrown on a request path, it's reported to the monitor. The configured
Monitor
is composed (see below for how composition works) with the default monitor implementation, com.twitter.finagle.util.DefaultMonitor, which logs these exceptions.Monitors are wired into the server or client stacks via com.twitter.finagle.filter.MonitorFilter and are applied to the following kinds of exceptions:
- Synchronous exceptions thrown on request path,
Service.apply(request)
- Asynchronous exceptions (failed futures) thrown on request path,
Service.apply(request)
- Exceptions thrown from
respond
,onSuccess
,onFailure
future callbacks - Fatal exceptions thrown from
map
,flatMap
,transform
future continuations
Put it this way, we apply
Monitor.handle
to an exception if we would otherwise "lose" it, i.e. when it's not connected to theFuture
, nor is it connected to the call stack.You can compose multiple monitors if you want to extend or override the standard behavior, defined in
DefaultMonitor
.import com.twitter.util.Monitor val consoleMonitor = new Monitor { def handle(exc: Throwable): Boolean = { Console.err.println(exc.toString) false // continue handling with the next monitor (usually DefaultMonitor) } } $.withMonitor(consoleMonitor)
Returning
true
form within a monitor effectively terminates the monitor chain so no exceptions are propagated down to the next monitor.- Definition Classes
- Client → CommonParams
- Synchronous exceptions thrown on request path,
- def withNoOpportunisticTls: Client
Disables opportunistic TLS.
Disables opportunistic TLS.
If the client is still TLS configured, it will speak with the server over TLS. To instead configure this to be
Off
, usewithOpportunisticTls(OpportunisticTls.Off)
. - def withNoRollback: Client
Removes the module on the client which issues a ROLLBACK statement each time a service is put back into the pool.
Removes the module on the client which issues a ROLLBACK statement each time a service is put back into the pool. This may result in better performance at the risk of receiving a connection from the pool with uncommitted state.
Instead of disabling this feature, consider configuring the connection pool for the client (via
withSessionPool
) to offer more available connections.- Note
the rollback module is installed by default.
- See also
https://dev.mysql.com/doc/en/implicit-commit.html
- def withOpportunisticTls(level: Level): Client
Configures the client whether to speak TLS or not.
Configures the client whether to speak TLS or not.
By default, don't use opportunistic TLS, and instead always speak TLS if TLS has been configured.
The valid levels are Off, which indicates this will never speak TLS, Desired, which indicates it may speak TLS, but may also not speak TLS, and Required, which indicates it must speak TLS.
Clients configured with level
Required
cannot speak to MySQL servers where TLS is switched off. - def withParams(params: Params): Client
Creates a new StackClient with
params
used to configure this StackClient'sstack
.Creates a new StackClient with
params
used to configure this StackClient'sstack
.- Definition Classes
- EndpointerStackClient → StackClient → Parameterized
- def withRequestTimeout(timeout: Duration): Client
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.Client's Request Timeout
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.
Server's Request Timeout
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.
- Definition Classes
- Client → CommonParams
- See also
https://twitter.github.io/finagle/guide/Clients.html#timeouts-expiration
- def withRequestTimeout(timeout: Tunable[Duration]): Client
Configures the Tunable request
timeout
of this server or client (if applying the Tunable produces a value ofNone
, an unbounded timeout is used for the request).Configures the Tunable request
timeout
of this server or client (if applying the Tunable produces a value ofNone
, an unbounded timeout is used for the request).If the request has not completed within the Duration resulting from
timeout.apply()
, the pending work will be interrupted via com.twitter.util.Future.raise.Client's Request Timeout
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.
Server's Request Timeout
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.
- def withResponseClassifier(responseClassifier: ResponseClassifier): Client
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
- Definition Classes
- Client → CommonParams
- Note
If unspecified, the default classifier is com.twitter.finagle.service.ResponseClassifier.Default which is a total function fully covering the input domain.
- See also
com.twitter.finagle.http.service.HttpResponseClassifier
for some HTTP classification tools.
- def withRetryBackoff(backoff: Backoff): Client
Configures the requeue backoff policy of this client (default: no delay).
Configures the requeue backoff policy of this client (default: no delay).
The policy encoded Backoff is used to calculate the next duration to delay each retry.
- Definition Classes
- Client → ClientParams
- See also
https://twitter.github.io/finagle/guide/Clients.html#retries
- def withRetryBudget(budget: RetryBudget): Client
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.- Definition Classes
- Client → ClientParams
- Note
The retry budget helps prevent clients from overwhelming the downstream service.
- See also
https://twitter.github.io/finagle/guide/Clients.html#retries
- def withRollback: Client
Installs a module on the client which issues a ROLLBACK statement when a service is put back into the pool.
Installs a module on the client which issues a ROLLBACK statement when a service is put back into the pool. This exists to ensure that a "clean" connection is always returned from the connection pool. For example, it prevents situations where an unfinished transaction has been written to the wire, the service has been released back into the pool, the same service is again checked out of the pool, and a statement that causes an implicit commit is issued.
The additional work incurred for the rollback may result in less throughput from the connection pool and, as such, may require configuring the pool (via
withSessionPool
) to offer more available connections connections.- Note
this module is installed by default.
- See also
https://dev.mysql.com/doc/en/implicit-commit.html
- def withServerRsaPublicKey(path: String): Client
To configure the local path to the server's RSA public key for encryption during
caching_sha2_password
authentication. - val withSession: ClientSessionParams[Client]
An entry point for configuring the client's session.
An entry point for configuring the client's session.
- Definition Classes
- Client → WithClientSession
- val withSessionPool: SessionPoolingParams[Client]
An entry point for configuring the client's session pool.
An entry point for configuring the client's session pool.
All session pool settings are applied to each host in the replica set. Put this way, these settings are per-host as opposed to per-client.
- Definition Classes
- Client → WithSessionPool
- See also
https://twitter.github.io/finagle/guide/Clients.html#pooling
- val withSessionQualifier: SessionQualificationParams[Client]
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).
- Definition Classes
- Client → WithSessionQualifier
- See also
https://twitter.github.io/finagle/guide/Clients.html#circuit-breaking
- def withStack(fn: (Stack[ServiceFactory[Request, Result]]) => Stack[ServiceFactory[Request, Result]]): Client
A new StackClient using the function to create a new Stack.
A new StackClient using the function to create a new Stack.
The input to
fn
is the client's current stack. This API allows for easier usage when writing code that uses method chaining.This method is similar to transformed while providing easier API ergonomics for one-off
Stack
changes.- Definition Classes
- Client → EndpointerStackClient → StackClient
From Scala:
import com.twitter.finagle.Http Http.client.withStack(_.prepend(MyStackModule))
From Java:
import com.twitter.finagle.Http; import static com.twitter.util.Function.func; Http.client().withStack(func(stack -> stack.prepend(MyStackModule)));
- See also
withStack(Stack)
Example: - def withStack(stack: Stack[ServiceFactory[Request, Result]]): Client
A new StackClient with the provided
stack
.A new StackClient with the provided
stack
.- Definition Classes
- Client → EndpointerStackClient → StackClient
- See also
withStack
that takes aFunction1
for a more ergonomic API when used with method chaining.
- def withStatsReceiver(statsReceiver: StatsReceiver): Client
Configures this server or client with given stats.StatsReceiver (default: stats.DefaultStatsReceiver).
Configures this server or client with given stats.StatsReceiver (default: stats.DefaultStatsReceiver).
- Definition Classes
- Client → CommonParams
- def withTracer(tracer: Tracer): Client
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).
- Definition Classes
- Client → CommonParams
- Note
if you supply com.twitter.finagle.tracing.NullTracer, no trace information will be written, but this does not disable Finagle from propagating trace information. Instead, if traces are being aggregated across your fleet, it will orphan subsequent spans.
- val withTransport: ClientTransportParams[Client]
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).- Definition Classes
- Client → WithClientTransport
Deprecated Value Members
- def transformed(f: (Stack[ServiceFactory[Request, Result]]) => Stack[ServiceFactory[Request, Result]]): Client
Creates a new StackClient with
f
applied tostack
.Creates a new StackClient with
f
applied tostack
.This is the same as withStack.
- Definition Classes
- EndpointerStackClient
- Annotations
- @deprecated
- Deprecated
(Since version 2018-10-30) Use withStack(Stack[ServiceFactory[Req, Rep]] => Stack[ServiceFactory[Req, Rep]]) instead