java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.CheckHandle
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class CheckHandle extends Handle
Check handles will run the given callback once per loop iteration, right
after polling for i/o .
See Check 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.voidsetCheckCallback(CheckCallback callback)Attach aCheckCallback.voidsetCloseCallback(CloseCallback callback)Attach aCloseCallback.intstart()Starts the handle with the callback specified.intstop()Stop the handle, the callback will no longer be called.
-
Method Details
-
setCheckCallback
Attach aCheckCallback.- Parameters:
callback- A Callback, which will be invoked once per loop iteration, right afterpolling for i/o .- Throws:
java.lang.IllegalStateException- if this method called more than once.
-
setCloseCallback
Attach aCloseCallback.- Parameters:
callback- A Callback, which will be invoked when check handle is closed.- Throws:
java.lang.IllegalStateException- if this method called more than once.
-
start
public int start()Starts the handle with the callback specified.- 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.CloseCallbackcallback will be invoked right before the close.
-