jarshwah / experiments-celery

A repo with celery configured for running experiments and debugging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

experiments-celery

A repo with celery configured for running experiments and debugging

Setup

  1. Install Docker and Docker Compose
  2. Setup a virtual environment with python 3.10+ and install the requirements
  3. Start the rabbitmq server: ./start-rmq.sh
  4. Start the celery worker: ./start.sh
  5. Open a python shell and start some tasks up:
from tasks import sleepy

sleepy.delay(10)
sleepy.apply_async((10,), countdown=20)

If you want to play with the behaviour of SIGTERM, find the PID of the celery parent task, and kill -TERM <pid>, or CTRL+C from the celery worker terminal.

ddtrace-run is used here as I was experimenting with how it may or may not affect the behaviour of the kill signal, but ddtrace-run doesn't act as a parent process and so does not impact TERM at all.

About

A repo with celery configured for running experiments and debugging


Languages

Language:Python 68.4%Language:Shell 31.6%