def _coordinateThisTask(self, task):
        worker = (self._idle.pop() if self._idle
                  else self._createWorker())
        if worker is None:
            # The createWorker method may return None if we're out of resources
            # to create workers.
            self._pending.append(task)
            return
        self._busyCount += 1
        @worker.do
        def doWork():
            try:
                task()
            except:
                self._logException()

            @self._coordinator.do
            def idleAndPending():
                self._busyCount -= 1
                self._recycleWorker(worker)
Select a worker to dispatch to, either an idle one or a new one, and
dataset/ETHPy150Open twisted/twisted/twisted/_threads/_team.py/Team._coordinateThisTask