-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert backward incompatible changes (api & binary) introduced in #2278…
… (#2306) Motivation: #2278 moved `RequestConcurrencyController` and `ReservableRequestConcurrencyController` from `client-api-internal` to `client-api` module. This is an API incompatible change for 0.42.x. Also, it removed `DefaultHttpLoadBalancerFactory#toLoadBalancedConnection` impl, this is a binary incompatible change. Modifications: - Restore `io.servicetalk.client.api.internal.RequestConcurrencyController` and `io.servicetalk.client.api.internal.ReservableRequestConcurrencyController` interfaces and all references to them in `client-api-internal` module; - Create a pkg-private copy of `ReservableRequestConcurrencyControllers` inside `http-netty` module that targets public `io.servicetalk.client.api.ReservableRequestConcurrencyController`; - Copy tests for `ReservableRequestConcurrencyControllers`; - Create a pkg-private copy of `io.servicetalk.client.api.internal.IgnoreConsumedEvent` in `http-netty` module; - Deprecate all classes and interfaces in `client-api-internal` module; - Remove unnecessary references to `servicetalk-client-api-internal` dependency in modules that don't actually depend on it; Result: 1. The next 0.42.14 release will be backward compatible with 0.42.13. 2. The whole `servicetalk-client-api-internal` module is deprecated now and can be removed in future releases.
- Loading branch information
1 parent
c7375c4
commit 5cfe9c4
Showing
28 changed files
with
579 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ternal/src/main/java/io/servicetalk/client/api/internal/RequestConcurrencyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright © 2018 Apple Inc. and the ServiceTalk project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.servicetalk.client.api.internal; | ||
|
||
import io.servicetalk.concurrent.api.Publisher; | ||
|
||
/** | ||
* An interface which allows controlling reserving connections which maybe used concurrently. | ||
* | ||
* @deprecated This interface is not used by ServiceTalk internal code anymore and will be removed in the future | ||
* releases. If you depend on it, consider replicating this implementation in your codebase or reach out to us | ||
* explaining the use-case. | ||
*/ | ||
@Deprecated // FIXME: 0.43 - remove deprecated interface | ||
public interface RequestConcurrencyController { | ||
|
||
/** | ||
* Result of the {@link #tryRequest()} call. | ||
*/ | ||
enum Result { | ||
/** | ||
* Selecting the resource succeeded. | ||
*/ | ||
Accepted, | ||
/** | ||
* Selecting the resource was denied, but may succeed at later time. | ||
*/ | ||
RejectedTemporary, | ||
/** | ||
* Selecting the resource was denied, and will not succeed at later time. | ||
*/ | ||
RejectedPermanently | ||
} | ||
|
||
/** | ||
* Attempts to reserve a connection for a single request, needs to be followed by {@link #requestFinished()}. | ||
* @return {@link Result#Accepted} if this connection is available and reserved for performing a single request. | ||
*/ | ||
Result tryRequest(); | ||
|
||
/** | ||
* Must be called after {@link #tryRequest()} to signify the request has completed. This method should be called | ||
* no more than once for each call to {@link #tryRequest()}. | ||
* <p> | ||
* Generally called from a {@link Publisher#beforeFinally(Runnable)} after a {@link #tryRequest()}. | ||
*/ | ||
void requestFinished(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../main/java/io/servicetalk/client/api/internal/ReservableRequestConcurrencyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright © 2018 Apple Inc. and the ServiceTalk project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.servicetalk.client.api.internal; | ||
|
||
import io.servicetalk.concurrent.api.Completable; | ||
|
||
/** | ||
* A {@link RequestConcurrencyController} that also allows to {@link #tryReserve()} a connection for exclusive use. | ||
* | ||
* @deprecated This interface is not used by ServiceTalk internal code anymore and will be removed in the future | ||
* releases. If you depend on it, consider replicating this implementation in your codebase or reach out to us | ||
* explaining the use-case. | ||
*/ | ||
@Deprecated // FIXME: 0.43 - remove deprecated interface | ||
public interface ReservableRequestConcurrencyController extends RequestConcurrencyController { | ||
|
||
/** | ||
* Attempts to reserve a connection for exclusive use until {@link #releaseAsync()} is called. | ||
* @return {@code true} if this connection is available and reserved for performing a single request. | ||
*/ | ||
boolean tryReserve(); | ||
|
||
/** | ||
* Must be called (and subscribed to) to signify the reservation has completed after {@link #tryReserve()}. | ||
* @return a {@link Completable} for the release. | ||
*/ | ||
Completable releaseAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.