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

(feat) Add FxRobot::interrupt() method to wait for the JavaFX thread. #240

Merged
merged 1 commit into from Dec 5, 2015

Conversation

hastebrot
Copy link
Member

Adds FxRobot::interrupt() which is a cousin to FxRobot::interact(). It is similar to the static method WaitForAsyncUtils.waitForFxEvents(), but has a shorter more memorizable method name.

  • interact() executes a callback in the JavaFX thread and waits for it and the events caused by it to complete.
  • interrupt() waits for the current events in the JavaFX thread and the events caused by these events to complete.

This waits for events in the JavaFX thread. It synchronizes the current thread with the JavaFX thread multiple times using a semaphore. The reason it synchronizes it multiple times is, that events in the JavaFX thread can enqueue additional events to this thread. Is also does not wait for all events in the event queue of the JavaFX thread to finish, because animations could run permanently in the background.

hastebrot added a commit that referenced this pull request Dec 5, 2015
(feat) Add `interrupt()` method to wait for the JavaFX thread.
@hastebrot hastebrot merged commit 5c3324f into TestFX:master Dec 5, 2015
@hastebrot hastebrot changed the title (feat) Add interrupt() method to wait for the JavaFX thread. (feat) Add FxRobot::interrupt() method to wait for the JavaFX thread. Dec 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant