Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
 def run(self):
     platforms.reset_signal("SIGTERM")
     self.service.start(embedded_process=True)
Пример #4
0
 def run(self):
     platforms.reset_signal("SIGTERM")
     self.service.start(embedded_process=True)