Repository navigation
Remove streamsupport-minifuture dependency - #107
Merged
FZambia merged 1 commit intoNov 10, 2026
Merged
Conversation
- Replace java8 `CompletableFuture` with a package-private `CallFuture` in `Client` and `Subscription` - Remove the `streamsupport-minifuture` dependency from `build.gradle` - Remove the `README` note about excluding minifuture - Update comments that mention `orTimeout` and `CompletableFuture` - Add `CallFutureTest` - Add a changelog entry
Member
|
@IliaKazakov hi, many thanks! I did a small follow-up - #108 - if you don't see nothing wrong with it I'll merge and make a release. Please take a look. |
FZambia
added a commit
that referenced
this pull request
Nov 10, 2026
* CallFuture follow-up: Consumer error handlers, accurate failure-path comments Error handlers passed to Client.settle are now CallFuture.Consumer<Throwable> instead of Function<Throwable, Void>, dropping the 'return null;' at every call site and the Function interface. Fix comments left over from #107: the connect timeout fails the future on the executor (the scheduler timer hops there first), and the connect error handler still defers to a separate executor task because a failure from failPendingCalls() arrives in the middle of processDisconnect. * CallFuture: reject a second listener even once the future is done The guard checked the listener field, which is never set for a listener registered after completion and is cleared on settle, so a second listener was rejected only while the future was pending.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ClientandSubscriptionno longer usejava8.util.concurrent.CompletableFuturefromstreamsupport-minifuture.Pending calls now use a small package-private
CallFuture: it completes once, with a result or an error, and notifies one listener on the completing thread (or at once, if the future is already done).The dependency is removed from
centrifuge/build.gradle, and the README note about excluding it is removed.Why
streamsupport-minifutureis licensed under GPL-2.0 with the Classpath Exception. Companies that cannot ship GPL code have to exclude it and replace the classes that the SDK calls. The SDK needs only one-shot completion and a single listener, so the dependency is not necessary.CallFutureuses onlysynchronized, so the supported Android versions do not change.java.util.concurrent.CompletableFuture(API 24+) is still not required.metalavaCheckCompatibilitypasses, and the production API signature is the same as onmaster.CompletionExceptionunwrap insettlewas unreachable, because futures are always completed directly.Tests
./gradlew :centrifuge:test: 109 passed, including 6 newCallFutureTestcases. One of them is acompletevscompleteExceptionallyrace over 1000 iterations../gradlew :centrifuge:integrationTest: 33 passed against Centrifugo v6 fromdocker-compose.yml.