Skip to content

Instantly share code, notes, and snippets.

@guigarage
Created October 22, 2014 16:40
Show Gist options
  • Save guigarage/d2ab01ac44b542224f43 to your computer and use it in GitHub Desktop.
Save guigarage/d2ab01ac44b542224f43 to your computer and use it in GitHub Desktop.
background thread - old way
Runnable backgroundRunnable = () -> {
try {
data = loadFromServer();
Platform.runLater(() -> {
updateUI(data);
});
} catch(Exception e) {
Platform.runLater(() -> {
handleException(e);
});
} finally {
Platform.runLater(() -> {
unblockUI();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment