New example: Distributed task queue
Adds an example of using Kubernetes to build a distributed task queue using Celery along with a RabbitMQ broker and Flower frontend. Resolves: #1788
This commit is contained in:
13
examples/celery-rabbitmq/celery-app-add/run_tasks.py
Normal file
13
examples/celery-rabbitmq/celery-app-add/run_tasks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import random
|
||||
import syslog
|
||||
import time
|
||||
|
||||
from celery_conf import add
|
||||
|
||||
while True:
|
||||
x = random.randint(1, 10)
|
||||
y = random.randint(1, 10)
|
||||
res = add.delay(x, y)
|
||||
time.sleep(5)
|
||||
if res.ready():
|
||||
res.get()
|
Reference in New Issue
Block a user