def register(self, task):
        def act(task):
            task.o.pending('waiting...')

            # Wait until we can be released (or if an error occurred for
            # another container).
            self._cv.acquire()
            while not self._satisfied(task.container) and not self._error:
                self._cv.wait(1)
            self._cv.release()

            # Abort if needed
            if self._error:
                task.o.commit(red('aborted!'))
                return

            try:
                self._concurrency.acquire(blocking=True)
                task.run(auditor=self._auditor)
                self._concurrency.release()
                self._done.add(task.container)
            except Exception:
                task.o.commit(red('failed!'))
                self._error = sys.exc_info()
            finally:
                self._cv.acquire()
                self._cv.notifyAll()
                self._cv.release()

        t = threading.Thread(target=act, args=(tuple([task])))
        t.daemon = True
        t.start()
        self._threads.add(t)
Register an orchestration action for a given container.
dataset/ETHPy150Open signalfx/maestro-ng/maestro/plays/__init__.py/BaseOrchestrationPlay.register