Skip to content

Instantly share code, notes, and snippets.

@Rafe
Created June 26, 2012 15:20
Show Gist options
  • Save Rafe/2996397 to your computer and use it in GitHub Desktop.
Save Rafe/2996397 to your computer and use it in GitHub Desktop.
celery-cheat
#Quick Cheat Sheet
T.delay(arg, kwarg=value)
#always a shortcut to .apply_async.
T.apply_async((arg, ), {'kwarg': value})
T.apply_async(countdown=10)
#executes 10 seconds from now.
T.apply_async(eta=now + timedelta(seconds=10))
#executes 10 seconds from now, specifed using eta
T.apply_async(countdown=60, expires=120)
#executes in one minute from now, but expires after 2 minutes.
T.apply_async(expires=now + timedelta(days=2))
#expires in 2 days, set using datetime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment