Skip to content

Commit

Permalink
Deprecate unused ClientInvoker interface (#2287)
Browse files Browse the repository at this point in the history
Motivation:

After simplifying offloading in #1695, `ClientInvoker` interface does
not provide any value and can be removed.

Modifications:

- Remove the remaining pkg-private use of `ClientInvoker`;
- Deprecate `ClientInvoker` interface;

Result:

`ClientInvoker` interface is deprecated and can be removed in the future
releases.
  • Loading branch information
idelpivnitskiy authored Jul 22, 2022
1 parent 2a0f45c commit da74e30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
* trailers, for the passed {@link StreamingHttpRequest} returns a {@link Single}.
*
* @param <State> The {@code state} type to use.
* @deprecated There is no use of this interface in our codebase, it will be removed in the future releases. If you
* depend on it, consider replicating a similar interface in your codebase.
*/
@Deprecated
@FunctionalInterface
public interface ClientInvoker<State> {
public interface ClientInvoker<State> { // FIXME: 0.43 - remove deprecated interface

/**
* Invokes the client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.servicetalk.concurrent.api.Completable;
import io.servicetalk.concurrent.api.Publisher;
import io.servicetalk.concurrent.api.Single;
import io.servicetalk.http.api.ClientInvoker;
import io.servicetalk.http.api.FilterableStreamingHttpConnection;
import io.servicetalk.http.api.HttpConnectionContext;
import io.servicetalk.http.api.HttpEventKey;
Expand Down Expand Up @@ -61,7 +60,7 @@
import static java.util.Objects.requireNonNull;

abstract class AbstractStreamingHttpConnection<CC extends NettyConnectionContext>
implements FilterableStreamingHttpConnection, ClientInvoker<FlushStrategy> {
implements FilterableStreamingHttpConnection {
private static final IgnoreConsumedEvent<Integer> ZERO_MAX_CONCURRENCY_EVENT = new IgnoreConsumedEvent<>(0);

final CC connection;
Expand Down Expand Up @@ -101,9 +100,8 @@ public final <T> Publisher<? extends T> transportEventStream(final HttpEventKey<
failed(new IllegalArgumentException("Unknown key: " + eventKey));
}

@Override
public final Single<StreamingHttpResponse> invokeClient(final Publisher<Object> flattenedRequest,
@Nullable final FlushStrategy flushStrategy) {
private Single<StreamingHttpResponse> makeRequest(final Publisher<Object> flattenedRequest,
@Nullable final FlushStrategy flushStrategy) {
return writeAndRead(flattenedRequest, flushStrategy).liftSyncToSingle(new SpliceFlatStreamToMetaSingle<>(
this::newSplicedResponse));
}
Expand Down Expand Up @@ -135,7 +133,7 @@ public Single<StreamingHttpResponse> request(final StreamingHttpRequest request)
flatRequest = flatRequest.subscribeOn(connectionContext.executionContext().executor(),
IoThreadFactory.IoThread::currentThreadIsIoThread);
}
Single<StreamingHttpResponse> resp = invokeClient(flatRequest, determineFlushStrategyForApi(request));
Single<StreamingHttpResponse> resp = makeRequest(flatRequest, determineFlushStrategyForApi(request));
if (strategy.isMetadataReceiveOffloaded()) {
resp = resp.publishOn(
connectionContext.executionContext().executor(),
Expand Down

0 comments on commit da74e30

Please sign in to comment.