-
Notifications
You must be signed in to change notification settings - Fork 102
More efficient round trip conversions for Futures #50
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
Merged
Conversation
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
@@ -6,7 +6,7 @@ package scala.concurrent.java8 | |||
// Located in this package to access private[concurrent] members | |||
|
|||
import scala.concurrent.{ Future, Promise, ExecutionContext, ExecutionContextExecutorService, ExecutionContextExecutor, impl } | |||
import java.util.concurrent.{ CompletionStage, Executor, ExecutorService, CompletableFuture } | |||
import java.util.concurrent._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't you shadowing scala.concurrent.Future now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, wildcards have a lower precendence:
scala> {import scala.concurrent.Future; import java.util.concurrent._; 0 : Future[_]}
<console>:8: error: type mismatch;
found : Int(0)
required: scala.concurrent.Future[_]
{import scala.concurrent.Future; import java.util.concurrent._; 0 : Future[_]}
^
retronym
added a commit
to retronym/scala
that referenced
this pull request
Aug 13, 2015
Doing so seems like the cleanest way to enabled conversions like `javaFuture.toScala.toJava` to return the original `javaFuture` in scala-java8-compat. I have made the methods defined in this class final as an alternative lockdown. Discussion, Motivation: scala/scala-java8-compat#46 scala/scala-java8-compat#50
retronym
added a commit
to retronym/scala
that referenced
this pull request
Aug 13, 2015
It was non-final in Scala 2.11.x, and made final as part of fa0743c. Removing the final modifier seems like the cleanest way to enable conversions like `javaFuture.toScala.toJava` to return the original `javaFuture` in scala-java8-compat. I have made the methods defined in this class final as an alternative lockdown. Discussion, Motivation: scala/scala-java8-compat#46 scala/scala-java8-compat#50
1967830
to
a176d57
Compare
Makes `toJava.toScala` and `toScala.toJava` a wrap-and-unwrap operation, rather than a wrap-and-rewrap. Removes the cross build on 2.12, we should wait until 2.12.0-M3 in which DefaultPromise is once again extendable. See: 4faeac5 scala/scala#4690
This looks good to me. |
retronym
added a commit
that referenced
this pull request
Aug 28, 2015
More efficient round trip conversions for Futures
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.
A straw man proposal, for discussion by @jroper @rkuhn and
@viktorklang.
See the second commit for details, as I've based this PR on
another in-flight PR.
Fixes #44