abraham-ai / eden

Eden converts your python function into a hosted endpoint with minimal changes to your existing code :mage_man:
GNU General Public License v3.0
47 stars 5 forks source link

add option to use rabitmq instead of redis for queue #38

Open Mayukhdeb opened 2 years ago

Mayukhdeb commented 2 years ago

a minimal example of celery running with rabbitmq locally is as follows:

from celery import Celery
from eden.celery_utils import run_celery_app

'''
sudo service rabbitmq-server start
sudo rabbitmqctl add_user eden eden
 rabbitmqctl set_permissions -p / eden ".*' ".*" ".*"
'''

app = Celery(__name__, backend='rpc://', broker='amqp://eden:eden@localhost:5672/')

@app.task
def add(x, y):
    return x + y

run_celery_app(
    app = app
)