java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.PrepareHandle
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class PrepareHandle extends Handle
Prepare handles will run the given callback once per loop iteration, right
before polling for i/o.
See Perpare handle
-
Field Summary
-
Method Summary
Modifier and Type Method Description voidclose()Close the handle and free up any resources that may be held by it.voidsetCloseCallback(CloseCallback callback)Attach aCloseCallback.voidsetPrepareCallback(PrepareCallback callback)Attach aPrepareCallback.intstart()Starts the prepare handle with the callback specifiedsetPrepareCallback(PrepareCallback).intstop()Stop the handle, the callback will no longer be called.
-
Method Details
-
setPrepareCallback
Attach aPrepareCallback.- Parameters:
callback- A Callback, which will be invoked once per loop iteration, right before polling for i/o.
-
setCloseCallback
Attach aCloseCallback.- Parameters:
callback- A Callback, which will be invoked when check handle is closed.
-
start
public int start()Starts the prepare handle with the callback specifiedsetPrepareCallback(PrepareCallback).- Returns:
0on success, or an errorcode < 0on failure.
-
stop
public int stop()Stop the handle, the callback will no longer be called.- Returns:
0on success, or an errorcode < 0on failure.
-
close
public void close()Close the handle and free up any resources that may be held by it.
-