Created
June 15, 2013 18:34
-
-
Save skillachie/5789085 to your computer and use it in GitHub Desktop.
Celery and MongoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery import Celery | |
import time | |
#Specify mongodb host and datababse to connect to | |
BROKER_URL = 'mongodb://localhost:27017/jobs' | |
celery = Celery('EOD_TASKS',broker=BROKER_URL) | |
#Loads settings for Backend to store results of jobs | |
celery.config_from_object('celeryconfig') | |
@celery.task | |
def add(x, y): | |
time.sleep(30) | |
return x + y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment