Ejemplo n.º 1
0
 def _tick_all(self):
     self._loop.call_later(self._batch_rate, self._tick_all)
     for cln in self._clients.values():
         try:
             if cln.status == ClientRunner.ClientRun and cln.conn:
                 cln.conn.send(ClientSend(self._batch_size))
         except Exception as e:
             print("Sent stop to client {} error {}".format(cln.name, e), file=self._out_file)
Ejemplo n.º 2
0
 def _tick_one(self, idx: int = 0):
     i = idx % len(self._clients)
     self._loop.call_later(self._batch_rate, self._tick_one, i + 1)
     key = list(self._clients)[i]
     cln = self._clients[key]
     try:
         if cln.status == ClientRunner.ClientRun and cln.conn:
             cln.conn.send(ClientSend(self._batch_size))
     except Exception as e:
         print("Sent stop to client {} error {}".format(cln.name, e), file=self._out_file)
Ejemplo n.º 3
0
 def _tick_all(self):
     self._logger.debug("_tick_all")
     self._loop.call_later(self._batch_rate, self._tick_all)
     for cln in self._clients.values():
         self._logger.debug("_tick_all cln {}".format(cln))
         try:
             if cln.status == ClientRunner.ClientRun and cln.conn:
                 cln.conn.send(ClientSend(self._batch_size))
         except Exception as e:
             self._logger.exception(
                 "Sent stop to client {} error {}".format(cln.name, e))
Ejemplo n.º 4
0
 def _tick_one(self, idx: int = 0):
     i = idx % len(self._clients)
     self._logger.debug("_tick_one idx {} i {}".format(idx, i))
     self._loop.call_later(self._batch_rate, self._tick_one, i + 1)
     key = list(self._clients)[i]
     cln = self._clients[key]
     self._logger.debug("_tick_one cln {}".format(cln))
     try:
         if cln.status == ClientRunner.ClientRun and cln.conn:
             cln.conn.send(ClientSend(self._batch_size))
     except Exception as e:
         self._logger.exception("Sent stop to client {} error {}".format(
             cln.name, e))