class_docstr: a popen-based pipe for parallel and distributed computing
class_docstr_tok: ["a","popen-based","pipe","for","parallel","and","distributed","computing"]
docstr: Return the response from the launched process.
  Return None if no response was received yet from a background process.
docstr_tok: ["Return","the","response","from","the","launched","process",".","Return","None","if","no","response","was","received","yet","from","a","background","process","."]
code: def response(self):
      """Return the response from the launched process.
      Return None if no response was received yet from a background process.
      """  # XXX: return bytes, decode to ascii, take encoding, or ???
  
      if self._stdout is None:
          raise PipeException(
              "'launch' is required after any reconfiguration"
          )
      if self.codec is True:
          codec = "ascii"
      elif self.codec is False:
          codec = False
      elif self.codec is None:
          codec = False
      else:
          codec = self.codec
      if self._response is not None:
          return _str(self._response, codec)
  
      # when running in foreground _pid is 0 (may change to -1)
      if self._pid <= 0:
          self._response = self._stdout.read()
          return _str(self._response, codec)
  
      # handle response from a background process
      def onData(selector, fobj):
          if self.verbose:
              print("handling pipe response")
          self._debug.info("on_remote")
          self._response = fobj.read()
          selector.state = False
          return
  
      def onTimeout(selector):
          selector.state = False
  
      sel = Selector()
      # sel._info.activate()
      sel.notifyOnReadReady(self._stdout, onData)
      sel.notifyWhenIdle(onTimeout)
      sel.watch(2.0)
      # reset _response to None to allow capture of a next response
      # from a background process
      return _str(self._response, codec)
  
file_path: pathos/pathos/connection.py
imports: import os
  import sys
  import signal
  import random
  import string
  from pathos.selector import Selector
  from pathos.util import _str
label_desc: Use image node_id 6 for calling the Pipe obj's underlying member method code with example usage: obj.response() and returns: _str, _str, _str