Skip to content

Instantly share code, notes, and snippets.

@lemonlatte
Created May 10, 2012 03:09
Show Gist options
  • Save lemonlatte/2650806 to your computer and use it in GitHub Desktop.
Save lemonlatte/2650806 to your computer and use it in GitHub Desktop.
celeryd -I q2_tasks -l info -Q tasks
celeryd -I q2_tasks -l info -Q count
BROKER_URL = "redis://localhost:6379/0"
# Redis Backend
CELERY_RESULT_BACKEND = "redis"
CELERY_REDIS_HOST = "localhost"
CELERY_REDIS_PORT = 6379
CELERY_REDIS_DB = 0
CELERY_SEND_EVENTS = True
# CELERY_DEFAULT_QUEUE = "default"
CELERY_DEFAULT_EXCHANGE = "default"
CELERY_QUEUES = {
"default": {
"exchange": "default"
},
"tasks": {
"exchange": "tasks"
},
"count": {
"exchange": "tasks"
}
}
from tasks import add
add.apply_async((1,1))
add.apply_async((1,1), queue='tasks')
add.apply_async((1,1), queue='count')
from celery.task import task
@task(exchange="tasks")
def add(x, y):
result = x + y
return "I am queue 2.", result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment