Exemplo n.º 1
0
def swarm_events_thread(args):
    swarm = SwarmClient(args)
    while True:
        try:
            swarm.event_listener(main_callback)
        except Exception:
            log.exception('Something bad happened')
Exemplo n.º 2
0
def swarm_events_thread(args):
    swarm = SwarmClient(args)
    while True:
        try:
            swarm.event_listener(main_callback)
        except Exception:
            log.exception('Something bad happened')
Exemplo n.º 3
0
 def run(self):
     """The thread loop."""
     log.info("Monitor thread started")
     swarm = SwarmClient(get_conf())
     while True:
         try:
             swarm.event_listener(lambda x: self._event_cb(x))
         except Exception:
             log.exception('Exception in monitor thread')
         time.sleep(1)  # wait a bit before retrying the connection
Exemplo n.º 4
0
 def run(self):
     """The thread loop."""
     log.info("Monitor thread started")
     swarm = SwarmClient(get_conf())
     while True:
         try:
             swarm.event_listener(lambda x: self._event_cb(x))
         except:
             log.exception('Exception in monitor thread')
         time.sleep(
             1
         )  # Usually we got disconnected, so wait a bit before retrying