-
Notifications
You must be signed in to change notification settings - Fork 186
chore: Remove Source#future in javadsl #2554
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
base: main
Are you sure you want to change the base?
Conversation
|
Was this deprecated in the 1.x series of Pekko? |
fa68d01 to
1e3b98f
Compare
|
@mdedetrich I will deprecate it in the 1.4.x with another pr |
ddbde72 to
5fb7cd7
Compare
That is my point. The code is not yet deprecated and I think there is a good chance that Java users have been using it. It causes us zero overhead to maintain the existing method. |
While I agree that the PR to deprecate the method should land first in Pekko 1.x series, leaving around the method in 2.0.x series is likely going to be pointless/useless because the only reason it exists is due to deficiencies in the current 1.x Pekko API where it leaks the usage of Scala futures to Actual Java users don't like and don't want to use Scala's future, and I would be shocked if anyone is actually using these methods aside from the usecase I described ergo some |
|
@mdedetrich Me too, as Java developer using Scala's future is a bit wired |
|
Even if we deprecate Java DSL Source.future, we don't yet have a release with the deprecation notice so I think this PR is getting well ahead of itself. Let's deprecate, get a release with the deprecation and see if there is any feedback before removing the method. |
|
As the javadoc says, this function is "Here for Java interoperability, the normal use from Java should be [[Source.completionStage]]". Ideally a 'healthy' codebase should likely not need this method, and use There might be places where we still only produce In this case AFAICS FutureConverters.asJava provides a simple drop-in replacement making this helper superfluous. For this reason I'd support deprecating in 1.x and removing already in 2.0.0: even if we discover cases where it is still hard to avoid a I'm not sure I think we should wait for a 1.x release with the deprecation before merging this PR, but I agree there's a risk we'd forget the deprecation, so I agree it would be good to get the deprecation in 1.x merged before we merge the removal for 2.x. |
|
Yes, it would be nice if we had a 1.5.x during the release cycle of 2.0.0 |
The big remaining issue here is ActorSystem but that is something that I will now look into given that 2.0.0-M1 is out.
Yes this is exactly the point, there already are future/completion stage converters that are part of Scala's stdlib for Scala 2.13+, including ones that are designs to be called within Java (converting Future to CompletionStage). Actually our codebase uses them frequently throughout, and we use those Future to CompletionStage converters in our Java tests (often because of these aforementioned uses of Future in Java APIs that we are gradually fixing)
I will approve PR once the deprecation lands in 1.4.x Pekko. |
5fb7cd7 to
89bd15c
Compare
This should be removed from javadsl
Deprecated for #2555