Parent: [e1b8d5] (diff)

Child: [ddf08c] (diff)

Download this file

task.py    14 lines (11 with data), 418 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class TaskController(object):
'''WSGI app providing web-like RPC
The purpose of this app is to allow us to replicate the
normal web request environment as closely as possible
when executing celery tasks.
'''
def __call__(self, environ, start_response):
task = environ['task']
result = task(restore_context=False)
start_response('200 OK', [])
return [ result ]