Skip to content

Instantly share code, notes, and snippets.

@RuedigerMoeller
Created September 27, 2014 22:12
Show Gist options
  • Save RuedigerMoeller/1b8dc67ff79f0410d7d1 to your computer and use it in GitHub Desktop.
Save RuedigerMoeller/1b8dc67ff79f0410d7d1 to your computer and use it in GitHub Desktop.
running a blocking call from inside an actor
exec( () -> {
try {
return new Promise(new URL("http://www.google.com").getContent());
} catch (IOException e) {
return new Promise(null, e);
}
}).then( (content, error) -> {
// handle result
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment