Skip to content

UpyExplorer/upy-rabbitmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

64 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

upy-rabbitmq

GitHub Org's stars PyPI - Python Version PyPI - License PyPI GitHub last commit



How to install?

pip install upy-rabbitmq

Config

Add an environment variation called RABBITMQ_URL in your project's .env file.

RABBITMQ_URL=amqp://user:password@remote.server.com:port//vhost

Callback Class

callback.py

import time
from upy_rabbitmq.callback import CallbackProcess

class MyCallBack(CallbackProcess):

    def process(self):
        time.sleep(5)
        print(self.body.decode())

Start Queue

worker.py

from upy_rabbitmq.worker import UpyMQWorker

worker = UpyMQWorker()
worker.start_queue(
    key="key",
    callback=MyCallBack
)

New Task

client.py

from upy_rabbitmq.client import UpyMQClient

client = UpyMQClient()
client.new_task(
    key="key",
    message="Hello"
)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Commit Style

  • โš™๏ธ FEATURE
  • ๐Ÿ“ PEP8
  • ๐Ÿ“Œ ISSUE
  • ๐Ÿชฒ BUG
  • ๐Ÿ“˜ DOCS
  • ๐Ÿ“ฆ PyPI
  • โค๏ธ๏ธ TEST
  • โฌ†๏ธ CI/CD
  • โš ๏ธ SECURITY

License

Distributed under the MIT License. See LICENSE for more information.