kubernetes/examples/celery-rabbitmq/celery-app-add/run_tasks.py
Karl Beecher 43ab8188c8 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
2015-03-06 09:15:14 +01:00

14 lines
224 B
Python

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()