79: implement AsyncHandle

Reviewed-by: jfdenise
This commit is contained in:
akhil 2013-11-18 13:13:33 -08:00
parent cbfa7c977f
commit 26cdf26de6

View File

@ -29,6 +29,7 @@ import java.nio.ByteBuffer;
import net.java.libuv.Address;
import net.java.libuv.Stats;
import net.java.libuv.cb.AsyncCallback;
import net.java.libuv.cb.CallbackHandler;
import net.java.libuv.cb.CheckCallback;
import net.java.libuv.cb.FileCallback;
@ -67,6 +68,16 @@ final class LoopCallbackHandler implements CallbackHandler {
this.eventLoop = eventLoop;
}
@Override
public void handleAsyncCallback(final AsyncCallback cb, final int status) {
try {
cb.onSend(status);
eventLoop.processQueuedEvents();
} catch (Exception ex) {
eventLoop.loop().getExceptionHandler().handle(ex);
}
}
@Override
public void handleCheckCallback(final CheckCallback cb, final int status) {
try {