# Python X2Go (Client) API Documentation (v0.6.1.4)

## x2go.guardian module

X2GoSessionGuardian class - a guardian thread that controls X2Go session threads and their sub-threads (like reverse forwarding tunnels, Paramiko transport threads, etc.).

class x2go.guardian.X2GoSessionGuardian(client_instance, auto_update_listsessions_cache=False, auto_update_listdesktops_cache=False, auto_update_listmounts_cache=False, auto_update_sessionregistry=False, auto_register_sessions=False, no_auto_reg_pubapp_sessions=False, refresh_interval=5, logger=None, loglevel=56)

  Bases: `Thread`

  `x2go.guardian.X2GoSessionGuardian` thread controls X2Go session threads and their sub-threads (like reverse forwarding tunnels, Paramiko transport threads, etc.). Its main function is to tidy up once a session gets interrupted (SIGTERM, SIGINT).

  There is one `x2go.guardian.X2GoSessionGuardian` for each `x2go.client.X2GoClient` instance (thus: for normal setups there should be _one_ `x2go.client.X2GoClient` and _one_ `x2go.guardian.X2GoSessionGuardian` in use).

  guardian()

    The handler of this `x2go.guardian.X2GoSessionGuardian` thread.

  stop_thread()

    Stop this `x2go.guardian.X2GoSessionGuardian` thread.