Last active
October 30, 2015 22:10
-
-
Save kcwill2/55de4ba292145db82266 to your computer and use it in GitHub Desktop.
a future pinned to the JavaFx app thread
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object JavaFXExecutionContext { | |
implicit val javaFxExecutionContext: ExecutionContext = ExecutionContext.fromExecutor(new Executor { | |
def execute(command: Runnable): Unit = { | |
Platform.runLater(command) | |
} | |
}) | |
} | |
... | |
val mJavaFxEc = JavaFXExecutionContext.javaFxExecutionContext | |
... | |
val future = Future { comp.init() }(mJavaFxEc)//on the JavaFx thread |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment