def wait
      config.ui.logger.debug { "wait" }
      pid, status = (Process.wait2(@pid) rescue nil)
      if !pid.nil? && !status.nil?
        data = (Marshal.load(Base64.decode64(@parent_reader.read.to_s)) rescue nil)
        config.ui.logger.debug { "read(#{data.inspect})" }
        !data.nil? and @result = data

        @parent_reader.close
        @parent_writer.close

        return [pid, status, data]
      end
      nil
    end
def wait
      config.ui.logger.debug { "wait" }
      pid, status = (Process.wait2(@pid) rescue nil)
      if !pid.nil? && !status.nil?
        data = (Marshal.load(Base64.decode64(@parent_reader.read.to_s)) rescue nil)
        config.ui.logger.debug { "read(#{data.inspect})" }
        !data.nil? and @result = data

        @parent_reader.close
        @parent_writer.close

        return [pid, status, data]
      end
      nil
    end
Wait for the background process to finish.

 If a process successfully finished, it's return value from the *process*
 block is stored into the result set.

 It's advisable to use something like the *at_exit* hook to ensure you don't
 leave orphaned processes.  For example, in the *at_exit* hook you could
 call *wait* to block until the child process finishes up.

 @return [Array<pid, status, data>] An array containing the pid,
   status and data returned from the process block.  If wait2() fails nil
   is returned.