-
Notifications
You must be signed in to change notification settings - Fork 102
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
Override mutating CompletableFuture methods to throw UOE #15
Comments
@viktorklang Is this still relevant if we start to support |
No, I am still unsure what the actual behavior will be once we have 2 disparate completion venues (this Issue wants to remove one of the venues). What's your thinking on how it ought to work? |
I'm not 100% sure what problem we're trying to solve: I'd appreciate a test case to show what you mean by haywire. Do you mean that a user might expect the following assertion to hold? val p = Promise[String]()
val cs = toJava(p.future)
cs.asInstanceOf[CompletionStage].complete("done")
assert(p.isComplete) That was what I was trying to explore in retronym@9805415 |
What happens when both the s.c.Future and the CompletableFuture gets completed, in different ordering? |
I think the semantics should be the same as if two places complete a completablefuture. |
@retronym But |
I would really appreciate some help to get this right. As I'm not an expert in this domain, but I do understand test cases, would you be able to contribute some (passing or failing)? Otherwise, please assume I know nothing and elaborate a little bit more with your review comments :) |
I won't be able to have a look at it until next week, if that's OK? |
No probs, this isn't urgent, I just wanted to get the ball rolling. |
Great, ping me on monday so we can see how to deal with this. |
@viktorklang @retronym It's well past monday, just figured you would want a ping anyway? |
LOL Thanks @ryantheleach, I'll have a look at it when I can (swamped this week). :) |
In
private class CF[T] extends CompletableFuture[T] with (Try[T] => Unit) {
as an example.So if a Java user downcasts to CompletableFuture, it won't go haywire.
The text was updated successfully, but these errors were encountered: