Hi,
1 - is there any lib or recommendation on our to go from Scala future to Java Completable future ?
I have a legacy system that i need to adapt to a scala lib that returns futures in its API.
2 -Also i was wondering how the intricacy between threadPool executor works. By intricacy i mean, the fact that from the legacy java app i would be working on the forkjoin common Pool and that scala lib has his own ThreadPool executors.
This last question is something i always wonder, how the communication between thread poolexecutor happens. In java you can somewhat poll, cancel future, so would you do that from another context.
Maatari
Hi,
1 - is there any lib or recommendation on our to go from Scala future to Java Completable future ?
I have a legacy system that i need to adapt to a scala lib that returns futures in its API.
2 -Also i was wondering how the intricacy between threadPool executor works. By intricacy i mean, the fact that from the legacy java app i would be working on the forkjoin common Pool and that scala lib has his own ThreadPool executors.
This last question is something i always wonder, how the communication between thread poolexecutor happens. In java you can somewhat poll, cancel future, so would you do that from another context
--
Maatari
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you Viktor.Concerning the second point, i might be making a problem out of something that is not :) .Maybe simply speaking: Does it cause an issue to let say wait for the completion of a future that is executed on another threadPool?I am in ThreadPool A, executing a future task A1 that spawn a future task B1 in the ThreadPool B.a - Then A1 wait for B1
b- A1 attach an onComplete/CallBack on B1 (via a map for instance), in which threadPool that callBack will be executed.
| @Test | |
| public void testToJavaSuccess() throws InterruptedException, | |
| ExecutionException { | |
| final Promise<String> p = promise(); | |
| final CompletionStage<String> cs = toJava(p.future()); | |
| final CompletableFuture<String> cp = (CompletableFuture<String>) cs; | |
| assertFalse("cs must not yet be completed", cp.isDone()); | |
| p.success("Hello"); | |
| assertTrue("cs must be completed by now", cp.isDone()); | |
| assertEquals("Hello", cp.get()); | |
| } |