Example #1
0
    def __init__(self):
        self.services = []  # list of the service obj
        self.tg = threadgroup.ThreadGroup()  # the thread for the service obj

        # signal for services that it is done. run_service() calls this to block
        # the stop() will call done.send to release
        # Note: service has it's own done (called _done)
        self.done = event.Event()
Example #2
0
 def __init__(self):
     self.services = []
     #创建ThreadGroup对象,其中该对象有绿色线程池属性(即如下的self.pool)
     self.tg = threadgroup.ThreadGroup()
     self.done = event.Event()
Example #3
0
    def __init__(self, threads=1000):
        self.tg = threadgroup.ThreadGroup(threads)

        # signal that the service is done shutting itself down:
        self._done = event.Event()
Example #4
0
 def __init__(self):
     self.services = []
     self.tg = threadgroup.ThreadGroup()
     self.done = event.Event()
Example #5
0
    def __init__(self, threads=100):
        # a threadGroup (see eventlets documentation for details)
        self.tg = threadgroup.ThreadGroup(threads)

        # signal that the service is done shutting itself down:
        self._done = event.Event()