def process_initializer(app, hostname): """Initializes the process so it can be used to process tasks. Used for multiprocessing environments. """ app = app_or_default(app) app.set_current() platforms.reset_signal(*WORKER_SIGRESET) platforms.ignore_signal(*WORKER_SIGIGNORE) platforms.set_mp_process_title("celeryd", hostname=hostname) # This is for Windows and other platforms not supporting # fork(). Note that init_worker makes sure it's only # run once per process. app.loader.init_worker() signals.worker_process_init.send(sender=None)
def process_initializer(app, hostname): """Initializes the process so it can be used to process tasks. Used for multiprocessing environments. """ app = app_or_default(app) [platforms.reset_signal(signal) for signal in WORKER_SIGRESET] [platforms.ignore_signal(signal) for signal in WORKER_SIGIGNORE] platforms.set_mp_process_title("celeryd", hostname=hostname) # This is for windows and other platforms not supporting # fork(). Note that init_worker makes sure it's only # run once per process. app.loader.init_worker() signals.worker_process_init.send(sender=None)
def run(self): platforms.reset_signal("SIGTERM") self.service.start(embedded_process=True)