Skip to content

Instantly share code, notes, and snippets.

@danfairs
Created August 28, 2012 16:06
Show Gist options
  • Save danfairs/3499547 to your computer and use it in GitHub Desktop.
Save danfairs/3499547 to your computer and use it in GitHub Desktop.
Class-based task
class BaseEnrich(object):
def __init__(self):
self.guesser = Guesser()
@task(ignore_result=True, base=BaseEnrich)
def enrich(self, data):
data['guess'] = self.guesser.guess('text')
return data
@task(ignore_result=True)
def enrich_and_save(tweet_json):
c = enrich.s(data) | group(persist.s(), index.s())
c.apply_async()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment