Commit 20ff082f authored by Valentin Valls's avatar Valentin Valls
Browse files

Provide helper to close the proxy

parent a0e15e61
......@@ -16,6 +16,7 @@ import logging
import psutil
import gevent
import typing
import signal
import bliss
from bliss.comm import rpc
......@@ -92,6 +93,27 @@ class FlintClient:
self._greenlets = None
self._callbacks = None
def close(self):
"""Close Flint and clean up this proxy."""
if self._proxy is None:
raise RuntimeError("No proxy connected")
self._proxy.close_application()
self.close_proxy()
def kill(self):
"""Interrupt Flint with SIGTERM and clean up this proxy."""
if self._pid is None:
raise RuntimeError("No proxy connected")
os.kill(self._pid, signal.SIGTERM)
self.close_proxy()
def kill9(self):
"""Interrupt Flint with SIGKILL and clean up this proxy."""
if self._pid is None:
raise RuntimeError("No proxy connected")
os.kill(self._pid, signal.SIGKILL)
self.close_proxy()
def __start_flint(self):
process = self.__create_flint()
try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment