servicetalk icon indicating copy to clipboard operation
servicetalk copied to clipboard

`ConnectionFactoryFilter` for HTTP requires execution strategy to make requests

Open NiteshKant opened this issue 6 years ago • 1 comments

HttpClientBuilder#appendConnectionFactoryFilter() has the following signature [1]:

    public abstract HttpClientBuilder<U, R, SDE> appendConnectionFactoryFilter(
            ConnectionFactoryFilter<R, FilterableStreamingHttpConnection> factory);

This means that a ConnectionFactoryFilter implementation if using the connection to make a request (or other methods which require a strategy) would require an HttpExecutionStrategy which may be hard to determine.

Other usecase for this factory is to filter connections, which becomes hard if we have the filter use the more broader interface of StreamingHttpConnection.

We may be able to improve APIs here a bit.

NiteshKant avatar Jun 20 '19 18:06 NiteshKant

See https://github.com/apple/servicetalk/pull/636#discussion_r295932625 ... we are currently using defaultStrategy() in ProxyConnectConnectionFactoryFilter as a workaround. The workaround should be updated after this issue is resolved.

Scottmitch avatar Jun 20 '19 19:06 Scottmitch