Last active
September 17, 2017 23:31
-
-
Save WoodProgrammer/5b10227beb0202bf076a9f22ffb0ee26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from celery import Celery | |
| from kombu import Exchange, Queue | |
| import time | |
| # Celery Config | |
| hastane_app = Celery() | |
| celeryconfig = {} | |
| celeryconfig['BROKER_URL'] = 'amqp://user:password@localhost:5672/%2f' | |
| celeryconfig['CELERY_QUEUES'] = ( | |
| Queue('tasks', Exchange('tasks'), routing_key='tasks', | |
| queue_arguments={'x-max-priority': 10}), | |
| ) | |
| celeryconfig['CELERY_ACKS_LATE'] = True | |
| celeryconfig['CELERYD_PREFETCH_MULTIPLIER'] = 1 | |
| hastane_app.config_from_object(celeryconfig) | |
| @hastane_app.task | |
| def kafa_tramvasi(): | |
| print("Kafa Tramvasi tedavi ediliyor..") | |
| time.sleep(10) | |
| print("Kafa Tramvasi tedavi edildi..") | |
| @hastane_app.task | |
| def kirik_cikik(): | |
| print("Alciya aliniyor..") | |
| time.sleep(5) | |
| print("Alciya alindi") | |
| @hastane_app.task | |
| def estetik(): | |
| print("Estetik İslem Basladi..") | |
| time.sleep(8) | |
| print("Estetik İslem Bitti..") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment