mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-25 16:38:11 +08:00
Both brokers are not atomic and cause all kinds of problems during testing. Needs more time. Meanwhile I want to release the pluggable broker backend.
35 lines
494 B
Python
35 lines
494 B
Python
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 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))
|