Posts

Showing posts with the label Daemon

Celery: Daemonic Processes Are Not Allowed To Have Children

Answer : billiard and multiprocessing are different libraries - billiard is the Celery project's own fork of multiprocessing . You will need to import billiard and use it instead of multiprocessing However the better answer is probably that you should refactor your code so that you spawn more Celery tasks instead of using two different ways of distributing your work. You can do this using Celery canvas from celery import group @app.task def sleepawhile(t): print("Sleeping %i seconds..." % t) time.sleep(t) return t def work(num_procs): return group(sleepawhile.s(randint(1, 5)) for x in range(num_procs)]) def test(self): my_group = group(work(randint(1, 5)) for x in range(5)) result = my_group.apply_async() result.get() I've attempted to make a working version of your code that uses canvas primitives instead of multiprocessing. However since your example was quite artificial it's not easy to come up with something th...