parameters: (self, process)
return_statement: return varnishlog_data
docstring: Add timeout support
docstring_summary: Add timeout support
docstring_tokens: Add timeout support
function: def _readVarnishLog(self, process):
      """Add timeout support
      """
      logging.info('Reading varnishlog with timeout:%r' % self._timeout)
      def _kill_process(pid):
        # support for python 2.5 and under.
        # Shall use process.terminate() for python2.6 and above
        os.kill(pid, signal.SIGTERM)
      watcher = threading.Timer(self._timeout, _kill_process, args=(process.pid,))
      watcher.start()
      varnishlog_data, _ = process.communicate()
      watcher.cancel()
      return varnishlog_data
function_tokens: def _readVarnishLog ( self , process ) : logging . info ( 'Reading varnishlog with timeout:%r' % self . _timeout ) def _kill_process ( pid ) : # support for python 2.5 and under. # Shall use process.terminate() for python2.6 and above os . kill ( pid , signal . SIGTERM ) watcher = threading . Timer ( self . _timeout , _kill_process , args = ( process . pid , ) ) watcher . start ( ) varnishlog_data , _ = process . communicate ( ) watcher . cancel ( ) return varnishlog_data