Files
django-q2/django_q/tests/tasks.py
Ilan 6826e75a37 docs: Added a report example
Also added  a test based on the example.
2015-07-16 14:03:07 +02:00

44 lines
613 B
Python

# simple countdown, returns nothing
from time import sleep
def countdown(n):
while n > 0:
n -= 1
def multiply(x, y):
return x * y
def count_letters(tup):
total = 0
for word in tup:
total += len(word)
return total
def count_letters2(obj):
return count_letters(obj.get_words())
def word_multiply(x, word=''):
return len(word) * x
def count_forever():
while True:
sleep(0.5)
def get_task_name(task):
return task.name
def get_user_id(user):
return user.id
def result(obj):
print('RESULT HOOK {} : {}'.format(obj.name, obj.result))