Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Tom Schindl
e(fx)clipse also uses FutureTask - we initially used CountDownLatch but it escapes my mind what was the reason for that change. BTW: We have many other clever util methods in this area - see -

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Herve Girod
We have a use case where we receive a LOT of processing orders in one Thread in a TCP socket and we have to perform the drawing in the JavaFX Thread, but also we must wait until the effective drawing has finished before ordering a new drawing (because otherwise some parameters could have changed

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Kevin Rushforth
We use runAndWait (using a CountDownLatch) in many of our unit tests. You might take a look at: tests/system/src/test/java/test/util/Util.java Its runAndWait method also handles propagating runtime exceptions and errors (e.g., assertion failures) from the body of the runAndWait back to the

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Benjamin Gudehus
I wonder, if it is possible to test JavaFX applications without blocking the main thread. User interactions could be completely simulated by using Event.fireEvent(...) and we could enqueue assertions in the JavaFX application thread, in which case the assertion library needs to support

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Stefan Fuchs
Hi, in my experience blocking your working thread for the JavaFX application thread is almost always a sign of bad application design. You can easily deadlock your application. In our quite complex JavaFX Application, we could eliminate almost all of its uses. However, in one case it is

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Benjamin Gudehus
Hi, Kevin. Thanks for the info! On Wed, Nov 2, 2016 at 5:36 PM, Kevin Rushforth wrote: > No. This isn't something we will do for JDK 9, which is feature complete > (with an exception process for critical requests, especially relating to > Jigsaw). I note in this case

Re: JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Kevin Rushforth
No. This isn't something we will do for JDK 9, which is feature complete (with an exception process for critical requests, especially relating to Jigsaw). I note in this case that it isn't clear whether we want to do this one at all. -- Kevin Benjamin Gudehus wrote: Hey! Are there plans

JavaFX 9: Expose PlatformImpl.runAndWait() as Platform.runAndWait()

2016-11-02 Thread Benjamin Gudehus
Hey! Are there plans to expose this API [1] in JavaFX 9? // NOTE: Add the following if we decide to expose it publicly // public static void runAndWait(Runnable runnable) { // PlatformImpl.runAndWait(runnable); // } [1] http://hg.openjdk.java.net/openjfx/9-dev/rt/file/