Class PrepareHandle

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

  • Method Details

    • setPrepareCallback

      public void setPrepareCallback​(PrepareCallback callback)
      Attach a PrepareCallback.
      Parameters:
      callback - A Callback, which will be invoked once per loop iteration, right before polling for i/o.
    • setCloseCallback

      public void setCloseCallback​(CloseCallback callback)
      Attach a CloseCallback.
      Parameters:
      callback - A Callback, which will be invoked when check handle is closed.
    • start

      public int start()
      Starts the prepare handle with the callback specified setPrepareCallback(PrepareCallback).
      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.