Merge branch 'master' of https://git.kmlabz.com/birbnetes/classification-service
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
edd55d9257
26
classification_service/utils/rabbit.py
Normal file
26
classification_service/utils/rabbit.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import pika
|
||||||
|
from config import *
|
||||||
|
|
||||||
|
"""
|
||||||
|
Rabbitmq setup
|
||||||
|
"""
|
||||||
|
|
||||||
|
__author__ = '@tormakris'
|
||||||
|
__copyright__ = "Copyright 2020, Birbnetes Team"
|
||||||
|
__module_name__ = "rabbit"
|
||||||
|
__version__text__ = "1"
|
||||||
|
|
||||||
|
credentials = pika.PlainCredentials(RABBITMQ_USERNAME, RABBITMQ_PASSWORD)
|
||||||
|
rabbitmq = pika.BlockingConnection(pika.ConnectionParameters(host=RABBITMQ_HOST, credentials=credentials))
|
||||||
|
rabbitmq_channel = rabbitmq.channel()
|
||||||
|
rabbitmq_channel.exchange_declare(exchange=RABBITMQ_EXCHANGE, exchange_type='fanout')
|
||||||
|
|
||||||
|
"""Usage:
|
||||||
|
from rabbit import rabbitmq_channel
|
||||||
|
rabbitmq_channel.basic_publish(
|
||||||
|
exchange=RABBITMQ_EXCHANGE,
|
||||||
|
routing_key='feature',
|
||||||
|
body=generated_tag)
|
||||||
|
"""
|
@ -4,6 +4,7 @@ Flask
|
|||||||
marshmallow
|
marshmallow
|
||||||
Flask-Classful
|
Flask-Classful
|
||||||
sentry-sdk
|
sentry-sdk
|
||||||
|
pika
|
||||||
|
|
||||||
pyAudioanalysis
|
pyAudioanalysis
|
||||||
numpy
|
numpy
|
||||||
|
Reference in New Issue
Block a user