pip install huey
python
from huey import RedisHuey
huey = RedisHuey('my-app')
python
@huey.task()
def add_numbers(a, b):
result = a + b
return result
result = add_numbers(10, 20)
print(result)
python
@huey.task()
@huey.multi_thread
def process_image(image):
return processed_image
result = process_image(image)
print(result)
python
@huey.task()
def process_data(data):
if data == 'wait':
huey.lock.acquire(blocking=True)
huey.lock.release()
data = 'wait'
result = process_data(data)
print(result)