def is_running(self):
'''Check if our proxied process is still running.'''
if 'proc' not in self.state:
return False
# Check if the process is still around
proc = self.state['proc']
if proc.proc.poll() == 0:
self.log.info('Cannot poll on process.')
return False
client = httpclient.AsyncHTTPClient()
req = httpclient.HTTPRequest('http://localhost:{}'.format(self.port))
try:
yield client.fetch(req)
self.log.debug('Got positive response from rstudio server')
except:
self.log.debug('Got negative response from rstudio server')
return False
return True
评论列表
文章目录