destroy

Destroys the Process by:

  • Sending it destroySignal (if it has not completed yet)

  • Closes all I/O streams

  • Stops all OutputFeed production (See OutputFeed.Waiter)

    • NOTE: This may not be immediate if there is buffered data on stdout or stderr. The contents of what are left on the stream(s) will be drained which may stay live briefly after destruction.

This MUST be called after you are done with the Process to ensure resource closure occurs.

NOTE: Depending on your ProcessException.Handler, if an error is produced (e.g. a file descriptor closure failure) and you choose to throw it from ProcessException.Handler.onException, the caller of this function will receive the exception. You can choose to ignore it (e.g. log only) by not throwing when the ProcessException.context is equal to CTX_DESTROY.

Return

this Process instance

See also