music2storage/__init__.py
def start_workers(self, workers_per_task=1):
        """
        Creates and starts the workers, as well as attaching a handler to terminate them gracefully when a SIGINT signal is received.

        :param int workers_per_task: Number of workers to create for each task in the pipeline
        """

        if not self.workers:
            for _ in range(workers_per_task):
                self.workers.append(Worker(self._download, self.queues['download'], self.queues['convert'], self.stopper))
                self.workers.append(Worker(self._convert, self.queues['convert'], self.queues['upload'], self.stopper))
                self.workers.append(Worker(self._upload, self.queues['upload'], self.queues['delete'], self.stopper))
                self.workers.append(Worker(self._delete, self.queues['delete'], self.queues['done'], self.stopper))

            self.signal_handler = SignalHandler(self.workers, self.stopper)
            signal.signal(signal.SIGINT, self.signal_handler)

            for worker in self.workers:
                worker.start()
def start_workers(self, workers_per_task=1):
        """
        Creates and starts the workers, as well as attaching a handler to terminate them gracefully when a SIGINT signal is received.

        :param int workers_per_task: Number of workers to create for each task in the pipeline
        """

        if not self.workers:
            for _ in range(workers_per_task):
                self.workers.append(Worker(self._download, self.queues['download'], self.queues['convert'], self.stopper))
                self.workers.append(Worker(self._convert, self.queues['convert'], self.queues['upload'], self.stopper))
                self.workers.append(Worker(self._upload, self.queues['upload'], self.queues['delete'], self.stopper))
                self.workers.append(Worker(self._delete, self.queues['delete'], self.queues['done'], self.stopper))

            self.signal_handler = SignalHandler(self.workers, self.stopper)
            signal.signal(signal.SIGINT, self.signal_handler)

            for worker in self.workers:
                worker.start()
Creates and starts the workers, as well as attaching a handler to terminate them gracefully when a SIGINT signal is received.

        :param int workers_per_task: Number of workers to create for each task in the pipeline