Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate org.apache.pekko.dispatch.Futures #1417

Open
raboof opened this issue Jul 29, 2024 · 3 comments
Open

Deprecate org.apache.pekko.dispatch.Futures #1417

raboof opened this issue Jul 29, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@raboof
Copy link
Member

raboof commented Jul 29, 2024

I think this class was introduced when Akka still supported Java versions before Java 8, which introduced CompletionStage.

We should probably try and deprecate org.apache.pekko.dispatch.Futures and any Java APIs that still produce/expect Futures, and introduce ones that work with CompletionStage.

@raboof raboof added the enhancement New feature or request label Jul 29, 2024
@pjfanning pjfanning added this to the 1.1.0-M2 milestone Jul 29, 2024
@pjfanning pjfanning removed this from the 1.1.0-M2 milestone Jul 29, 2024
@pjfanning
Copy link
Contributor

I had a quick look at this and I think this Futures class is useful. See #1418 for the PR that convinced that this change is not a good idea.

raboof added a commit to raboof/pekko that referenced this issue Jul 29, 2024
Sketching out apache#1417 - incomplete and notably not bothering
with binary compatibility yet, just to illustrate the idea.
@raboof
Copy link
Member Author

raboof commented Jul 29, 2024

I didn't intend to suggest Java users should use Future$.MODULE$.failed and such: what I was thinking is that Java users shouldn't need to touch the Scala Future at all, and we should make sure that where they currently must use Future, we provide equivalent APIs using the more Java-native CompletionStage.

Something along the lines of (sketch) https://github.com/apache/pekko/compare/main...raboof:pekko:no-scala-futures-in-java?expand=1

The Promise is useful and doesn't seem to have a direct counterpart in standard Java, but perhaps we should then introduce a Promise utility that works with CompletionStage / CompletableFuture as well.

@pjfanning
Copy link
Contributor

90% of the internal Pekko usages of org.apache.pekko.dispatch.Futures are in Java unit tests.
I guess we could move the code to a test class and deprecate the org.apache.pekko.dispatch.Futures class.
Some of the tests are linked in the Paradox documentation though.

FutureTimeoutSupport has one usage that could moved internal to that class.

raboof added a commit to raboof/pekko that referenced this issue Jul 29, 2024
Sketching out apache#1417 - incomplete and notably not bothering
with binary compatibility yet, just to illustrate the idea.
raboof added a commit to raboof/pekko that referenced this issue Jul 30, 2024
Sketching out apache#1417 - incomplete and notably not bothering
with binary compatibility yet, just to illustrate the idea.
raboof added a commit to raboof/pekko that referenced this issue Aug 2, 2024
Sketching out apache#1417 - incomplete and notably not bothering
with binary compatibility yet, just to illustrate the idea.
raboof added a commit to raboof/pekko that referenced this issue Aug 2, 2024
Sketching out apache#1417 - incomplete and notably not bothering
with binary compatibility yet, just to illustrate the idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants