Class IdleHandle

java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.IdleHandle
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class IdleHandle
extends Handle
Idle handles will run the given callback once per loop iteration, right before the PrepareCallback handles.

See Idle handle

  • Method Details

    • setIdleCallback

      public void setIdleCallback​(IdleCallback callback)
      Attach a IdleCallback.
      Parameters:
      callback - A Callback, which will be invoked once per loop iteration, right before the PrepareCallback handles.
    • 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 idle handle with the callback specified setIdleCallback(IdleCallback).
      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.