docs(routing.md): add queueing to docs

This commit is contained in:
Krrish Dholakia 2023-11-21 18:00:14 -08:00
parent a2681e353f
commit 9d97082eed
9 changed files with 244 additions and 261 deletions

View file

@ -1,9 +1,12 @@
import os
from multiprocessing import Process
def run_worker():
os.system("celery worker -A your_project_name.celery_app --concurrency=10 --loglevel=info")
def run_worker(cwd):
os.chdir(cwd)
os.system("celery -A celery_app.celery_app worker --concurrency=120 --loglevel=info")
if __name__ == "__main__":
worker_process = Process(target=run_worker)
worker_process.start()
def start_worker(cwd):
cwd += "/queue"
worker_process = Process(target=run_worker, args=(cwd,))
worker_process.start()