Skip to content

Commit

Permalink
Restore public API changes for grpc-api (#1548)
Browse files Browse the repository at this point in the history
Motivation:

All public API breaking changes should be deferred until 0.41.0.

Modifications:

- Restore `grpc-api` that was removed in #1501.

Result:

No public API changes for 0.40.0.
  • Loading branch information
idelpivnitskiy authored May 11, 2021
1 parent c525813 commit e055ea7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import io.servicetalk.client.api.ConnectionFactoryFilter;
import io.servicetalk.client.api.ServiceDiscoverer;
import io.servicetalk.client.api.ServiceDiscovererEvent;
import io.servicetalk.concurrent.api.AsyncContextMap;
import io.servicetalk.concurrent.api.Single;
import io.servicetalk.grpc.internal.DeadlineUtils;
import io.servicetalk.http.api.FilterableStreamingHttpConnection;
import io.servicetalk.http.api.HttpExecutionStrategy;
import io.servicetalk.http.api.HttpLoadBalancerFactory;
Expand Down Expand Up @@ -53,6 +55,15 @@
public abstract class GrpcClientBuilder<U, R>
implements SingleAddressGrpcClientBuilder<U, R, ServiceDiscovererEvent<R>> {

/**
* gRPC timeout is stored in context as a deadline so that when propagated to a new request the remaining time to be
* included in the request can be calculated.
*
* @deprecated Do not use. This is internal implementation details that users should not depend on.
*/
@Deprecated
protected static final AsyncContextMap.Key<Long> GRPC_DEADLINE_KEY = DeadlineUtils.GRPC_DEADLINE_KEY;

private boolean appendedCatchAllFilter;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
import java.time.Duration;
import javax.annotation.Nullable;

import static io.servicetalk.grpc.internal.DeadlineUtils.EIGHT_NINES;

/**
* Metadata for a <a href="https://www.grpc.io">gRPC</a> client call.
*/
public interface GrpcClientMetadata extends GrpcMetadata {

/**
* Maximum timeout which can be specified for a <a href="https://www.grpc.io">gRPC</a>
* <a href="https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests">request</a>. Note that this
* maximum is effectively infinite as the duration is more than 11,000 years.
*
* @deprecated Do not use. This constant will be removed in future releases. If necessary, define an alternative
* constant in your application or use {@code null} for infinite {@link #timeout() timeout}.
*/
@Deprecated
Duration GRPC_MAX_TIMEOUT = Duration.ofHours(EIGHT_NINES);

/**
* {@link GrpcExecutionStrategy} to use for the associated
* <a href="https://www.grpc.io">gRPC</a> method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
package io.servicetalk.grpc.api;

import io.servicetalk.buffer.api.BufferAllocator;
import io.servicetalk.concurrent.api.AsyncContextMap;
import io.servicetalk.concurrent.api.Single;
import io.servicetalk.grpc.internal.DeadlineUtils;
import io.servicetalk.http.api.HttpExecutionStrategy;
import io.servicetalk.http.api.HttpProtocolConfig;
import io.servicetalk.http.api.HttpRequest;
Expand Down Expand Up @@ -53,6 +55,15 @@
*/
public abstract class GrpcServerBuilder {

/**
* gRPC timeout is stored in context as a deadline so that when propagated to a new client request the remaining
* time to be included in the request can be calculated.
*
* @deprecated Do not use. This is internal implementation details that users should not depend on.
*/
@Deprecated
protected static final AsyncContextMap.Key<Long> GRPC_DEADLINE_KEY = DeadlineUtils.GRPC_DEADLINE_KEY;

private boolean appendedCatchAllFilter;

/**
Expand Down

0 comments on commit e055ea7

Please sign in to comment.