Skip to content
Snippets Groups Projects
minion.py 404 B
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
#!/usr/bin/env python

import random
import time

from manager import QueueClient


class Minion(QueueClient):
    def run(self):
        while True:
            task = self.queue.get()
            print('got task', task)
            time.sleep(random.randint(5, 15))
            print('work done for task', task)
            print('result is', task ** 3)


if __name__ == '__main__':
    Minion().run()