via self.queue from connected servers' clients."""
self.queue = queue.Queue()
+
+ # optionally use this for main thread profiling:
+ # import cProfile
+ # class ProfiledThread(threading.Thread):
+ # def run(self):
+ # profiler = cProfile.Profile()
+ # profiler.runcall(threading.Thread.run, self)
+ # print('profiled thread finished')
+ # profiler.dump_stats('profile')
+ # c = ProfiledThread(target=self.loop, args=(self.queue,))
c = threading.Thread(target=self.loop, args=(self.queue,))
+
c.start()
def start_server(self, port, server_class, certfile=None, keyfile=None):