class Instance
	
	
	Represents a running child process from the point of view of the child process.
Definitions
def self.for(process)
Wrap an instance around the Process instance from within the forked child.
Signature
	- 
					parameter processProcess
- The process intance to wrap. 
Implementation
						def self.for(process)
	instance = self.new(process.out)
	
	# The child process won't be reading from the channel:
	process.close_read
	
	instance.name = process.name
	
	return instance
enddef initialize(io)
Initialize the child process instance.
Signature
	- 
					parameter ioIO
- The IO object to use for communication. 
Implementation
						def initialize(io)
	super
	
	@name = nil
enddef as_json(...)
Generate a hash representation of the process.
Signature
	- 
					returns Hash
- The process as a hash, including - process_idand- name.
Implementation
						def as_json(...)
	{
		process_id: ::Process.pid,
		name: @name,
	}
enddef to_json(...)
Generate a JSON representation of the process.
Signature
	- 
					returns String
- The process as JSON. 
Implementation
						def to_json(...)
	as_json.to_json(...)
enddef name=(value)
Set the process title to the specified value.
Signature
	- 
					parameter valueString
- The name of the process. 
Implementation
						def name= value
	@name = value
	
	# This sets the process title to an empty string if the name is nil:
	::Process.setproctitle(@name.to_s)
enddef name
Signature
	- 
					returns String
- The name of the process. 
Implementation
						def name
	@name
enddef exec(*arguments, ready: true, **options)
Replace the current child process with a different one. Forwards arguments and options to ::Process.exec.
This method replaces the child process with the new executable, thus this method never returns.
Signature
	- 
					parameter argumentsArray
- The arguments to pass to the new process. 
- 
					parameter readyBoolean
- If true, informs the parent process that the child is ready. Otherwise, the child process will need to use a notification protocol to inform the parent process that it is ready. 
- 
					parameter optionsHash
- Additional options to pass to - ::Process.exec.
Implementation
						def exec(*arguments, ready: true, **options)
	if ready
		self.ready!(status: "(exec)")
	else
		self.before_spawn(arguments, options)
	end
	
	::Process.exec(*arguments, **options)
end