Created
February 18, 2014 14:05
-
-
Save purplefox/9071594 to your computer and use it in GitHub Desktop.
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
final Context ctx = vertx.currentContext(); | |
otherLibrary.doSomethingAsync("foo", new Runnable() { | |
public void run() { | |
// This will be executed on the other library's thread so we need to make sure the result is done on the correct context | |
ctx.runOnContext(new Handler<Void>() { | |
public void handle(Void v) { | |
// Now we are on the right context - use the Vert.x API as normal | |
request.response().end("blah"); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment