mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Adds an example of using Kubernetes to build a distributed task queue using Celery along with a RabbitMQ broker and Flower frontend. Resolves: #1788
		
			
				
	
	
		
			14 lines
		
	
	
		
			224 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			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()
 |