SubProcess

replpp.shaded.os.SubProcess
See theSubProcess companion object
class SubProcess(val wrapped: Process, val inputPumperThread: Option[Thread], val outputPumperThread: Option[Thread], val errorPumperThread: Option[Thread], val shutdownGracePeriod: Long, val shutdownHookMonitorThread: Option[Thread]) extends ProcessLike

Represents a spawn subprocess that has started and may or may not have completed.

Attributes

Companion
object
Graph
Supertypes
trait ProcessLike
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Constructors

def this(wrapped: Process, inputPumperThread: Option[Thread], outputPumperThread: Option[Thread], errorPumperThread: Option[Thread])

Concrete methods

def close(): Unit

Alias for destroy

Alias for destroy

Attributes

def destroy(): Unit

Attempt to destroy the subprocess (gently), via the underlying JVM APIs

Attempt to destroy the subprocess (gently), via the underlying JVM APIs

Attributes

def destroy(shutdownGracePeriod: Long, async: Boolean): Unit

Destroys the subprocess, via the underlying JVM APIs, with configurable levels of aggressiveness:

Destroys the subprocess, via the underlying JVM APIs, with configurable levels of aggressiveness:

Value parameters

async

set this to true if you do not want to wait on the subprocess exiting

shutdownGracePeriod

use this to override the default wait time for the subprocess to gracefully exit before destroying it forcibly. Defaults to the shutdownGracePeriod that was used to spawned the process, but can be set to 0 (i.e. force exit immediately) or -1 (i.e. never force exit) or anything in between. Typically defaults to 100 milliseconds.

Attributes

def exitCode(): Int

The subprocess' exit code. Conventionally, 0 exit code represents a successful termination, and non-zero exit code indicates a failure.

The subprocess' exit code. Conventionally, 0 exit code represents a successful termination, and non-zero exit code indicates a failure.

Throws an exception if the subprocess has not terminated

Attributes

def isAlive(): Boolean

Returns true if the subprocess is still running and has not terminated

Returns true if the subprocess is still running and has not terminated

Attributes

def waitFor(timeout: Long): Boolean

Wait up to millis for the subprocess to terminate, by default waits indefinitely. Returns true if the subprocess has terminated by the time this method returns.

Wait up to millis for the subprocess to terminate, by default waits indefinitely. Returns true if the subprocess has terminated by the time this method returns.

Attributes

Deprecated methods

def destroyForcibly(): Unit

Force-destroys the ProcessLike, via the underlying JVM APIs

Force-destroys the ProcessLike, via the underlying JVM APIs

Attributes

Deprecated
true

Inherited methods

def join(timeout: Long, timeoutGracePeriod: Long): Boolean

Wait up to millis for the ProcessLike to terminate and all stdout and stderr from the subprocess to be handled. By default waits indefinitely; if a time limit is given, explicitly destroys the ProcessLike if it has not completed by the time the timeout has occurred.

Wait up to millis for the ProcessLike to terminate and all stdout and stderr from the subprocess to be handled. By default waits indefinitely; if a time limit is given, explicitly destroys the ProcessLike if it has not completed by the time the timeout has occurred.

By default, a process is destroyed by sending a SIGTERM signal, which allows an opportunity for it to clean up any resources it was using. If the process is unresponsive to this, a SIGKILL signal is sent timeoutGracePeriod milliseconds later. If timeoutGracePeriod is 0, then there is no SIGTERM; if it is -1, there is no SIGKILL sent.

Attributes

Note

the issuing of SIGTERM instead of SIGKILL is implementation dependent on your JVM version. Pre-Java 9, no SIGTERM may be issued. Check the documentation for your JDK's Process.destroy.

Inherited from:
ProcessLike

Concrete fields

val errorPumperThread: Option[Thread]
val inputPumperThread: Option[Thread]
val outputPumperThread: Option[Thread]
val shutdownHookMonitorThread: Option[Thread]
val wrapped: Process