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

Override mutating CompletableFuture methods to throw UOE #15

Open
viktorklang opened this issue Mar 27, 2014 · 12 comments
Open

Override mutating CompletableFuture methods to throw UOE #15

viktorklang opened this issue Mar 27, 2014 · 12 comments

Comments

@viktorklang
Copy link

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.

@retronym
Copy link
Member

@viktorklang Is this still relevant if we start to support toCompletableFuture as proposed in #49 ?

@viktorklang
Copy link
Author

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?

@retronym
Copy link
Member

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

@viktorklang
Copy link
Author

What happens when both the s.c.Future and the CompletableFuture gets completed, in different ordering?
What happens when obtrudeValue / obtrudeException is used?

@retronym
Copy link
Member

I think the semantics should be the same as if two places complete a completablefuture.

@viktorklang
Copy link
Author

@retronym But obtrude has different semantics?

@retronym
Copy link
Member

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 :)

@viktorklang
Copy link
Author

I won't be able to have a look at it until next week, if that's OK?

@retronym
Copy link
Member

No probs, this isn't urgent, I just wanted to get the ball rolling.

@viktorklang
Copy link
Author

Great, ping me on monday so we can see how to deal with this.

@ryantheleach
Copy link

@viktorklang @retronym It's well past monday, just figured you would want a ping anyway?

@viktorklang
Copy link
Author

LOL

Thanks @ryantheleach, I'll have a look at it when I can (swamped this week). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants