Class CheckHandle

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
  • Method Details

    • setCheckCallback

      public void setCheckCallback​(CheckCallback callback)
      Attach a CheckCallback.
      Parameters:
      callback - A Callback, which will be invoked once per loop iteration, right after polling for i/o.
      Throws:
      java.lang.IllegalStateException - if this method called more than once.
    • setCloseCallback

      public void setCloseCallback​(CloseCallback callback)
      Attach a CloseCallback.
      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:
      0 on success, or an error code < 0 on failure.
    • stop

      public int stop()
      Stop the handle, the callback will no longer be called.
      Returns:
      0 on success, or an error code < 0 on failure.
    • close

      public void close()
      Close the handle and free up any resources that may be held by it.

      CloseCallback callback will be invoked right before the close.