Created
September 27, 2014 22:12
-
-
Save RuedigerMoeller/1b8dc67ff79f0410d7d1 to your computer and use it in GitHub Desktop.
running a blocking call from inside an actor
This file contains 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
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