Skip to main content

Basic RabbitMQ

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upy-rabbitmq-0.0.6.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

upy_rabbitmq-0.0.6-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file upy-rabbitmq-0.0.6.tar.gz.

File metadata

  • Download URL: upy-rabbitmq-0.0.6.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for upy-rabbitmq-0.0.6.tar.gz
Algorithm Hash digest
SHA256 b06d69e28eec6bfa71017337e66b4482dbbe9804aac4ca2015c1c4ea2adcff4d
MD5 82ebcf3407cfc984eeea9dc04dd266f1
BLAKE2b-256 d8970e5f234698f5cd57c8f09478b031a9141bb5f0b65f59f2b44315e309f43a

See more details on using hashes here.

File details

Details for the file upy_rabbitmq-0.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for upy_rabbitmq-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7498b03a7e0cf87fef8f06af745a27bc8a1a721fca155cc8cb99a87ea3cb4c79
MD5 5a465862bf55084d1dc87ae2557a523a
BLAKE2b-256 14bda4a89bbe8174e595f14e8cb621ff1f3eea0d7b2d709f6e54390225fc5123

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page