Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created March 5, 2012 20:51
Show Gist options
  • Save kennethreitz/1980996 to your computer and use it in GitHub Desktop.
Save kennethreitz/1980996 to your computer and use it in GitHub Desktop.
from celery.task.control import task, rate_limit
def send_shit(article):
...
def user_send(user, article):
taskname = "send.{user}".format(user.name)
t = task(name=taskname)(send_shit)
rate_limit(taskname, "1/s")
return t(article)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment