Exemple #1
0
    def test_basic_addition(self):
        """
        Tests that 1 + 1 always equals 2.
        """
        jobs = []

        for x in range(1,10):
            st = add.subtask((1, x))
            jobs.append(st)

        job = group(jobs)
        result = job.apply_async()
        joined = result.join()

        self.assertEqual(1 + 1, 2)
Exemple #2
0
def index(request):
    # return HttpResponse("Hello, world. You're at the poll index.")
    from hackday.tasks import add
    from celery import group

    jobs = []

    for x in range(1,10):
        st = add.subtask((1, x))
        jobs.append(st)

    job = group(jobs)
    result = job.apply_async()
    res = result.join()
    return render_to_response('index.html', {'poll': result})
Exemple #3
0
from hackday.tasks import add
from celery import group

jobs = []

for x in range(1,10):
    st = add.subtask((1, x))
    jobs.append(st)

job = group(jobs)
result = job.apply_async()
result.join()