Skip to content

Instantly share code, notes, and snippets.

@guigarage
Created October 22, 2014 16:41
Show Gist options
  • Save guigarage/cc7af84f21c6020dd64d to your computer and use it in GitHub Desktop.
Save guigarage/cc7af84f21c6020dd64d to your computer and use it in GitHub Desktop.
Background thread DataFX way - ProcessChain
ProcessChain.create().
addRunnableInPlatformThread(() -> blockUI()).
addSupplierInExecutor(() -> loadFromServer()).
addConsumerInPlatformThread(d -> updateUI(d)).
onException(e -> handleException(e)).
withFinal(() -> unblockUI()).
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment