Skip to main content

Pynenc RabbitMq Plugin

CI codecov PyPI version Python versions

RabbitMq state backend plugin for Pynenc, providing distributed task state management using RabbitMq as the storage backend.

Features

  • 🚀 High Performance: Optimized RabbitMq operations with connection pooling
  • 🔒 Distributed Locking: RabbitMq-based distributed locks for task coordination
  • 🎯 Type Safe: Full type hints and mypy compatibility
  • 🧪 Well Tested: Comprehensive test suite with multiple RabbitMq versions
  • 📊 Production Ready: Battle-tested configuration options and monitoring

Quick Start

Installation

pip install pynenc-rabbitmq

Basic Usage

from pynenc import Pynenc
from pynenc_rabbitmq import RabbitMqStateBackend

# Create Pynenc app with RabbitMq backend
app = Pynenc().with_state_backend(
    RabbitMqStateBackend.from_uri("rabbitmq://localhost:27017/pynenc")
)

@app.task
def my_task(x: int, y: int) -> int:
    return x + y

# Use your tasks as normal
result = my_task(1, 2)

Configuration

Connection Configuration

from pynenc_rabbitmq import RabbitMqStateBackend, ConfigRabbitMq

config = ConfigRabbitMq(
    uri="rabbitmq://localhost:27017",
    database_name="my_pynenc_db",
    max_pool_size=100,
    write_concern_w="majority",
    read_preference="primaryPreferred"
)

backend = RabbitMqStateBackend(config)

Environment Variables

You can also configure via environment variables:

export PYNENC_RABBITMQ_URI="rabbitmq://localhost:27017"
export PYNENC_RABBITMQ_DATABASE="pynenc"
export PYNENC_RABBITMQ_MAX_POOL_SIZE="100"

Documentation

Development

Setup

  1. Clone the repository
  2. Install dependencies: poetry install --with dev
  3. Start RABBITMQ: docker-compose -f docker/docker-compose.yml up -d
  4. Run tests: poetry run pytest

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for pynenc-rabbitmq 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynenc-rabbitmq 0.1.6
File Size Uploaded
pynenc_rabbitmq-0.1.6.tar.gz 417.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynenc-rabbitmq 0.1.6
File Interpreter ABI Platform
pynenc_rabbitmq-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 431.5 kB

Release files / pynenc_rabbitmq-0.1.6.tar.gz

Download URL pynenc_rabbitmq-0.1.6.tar.gz
Size 417.1 kB
Tags Source
SHA-256 checksum
How to use checksums
868e7640893a0ba5af7bcef30e60d88bd6b8d007ca971e11f015a07b81d950bd
BLAKE2b-256 checksum
How to use checksums
eaadd6ad6799d1fd076625ec7974d07eddd42cd142300a06d99bf4443ae8035f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pynenc_rabbitmq-0.1.6-py3-none-any.whl

Download URL pynenc_rabbitmq-0.1.6-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98b354b47d0a77f61823a2cfd38593cd789ab3ca3e3a642e6687bc1c615f5482
BLAKE2b-256 checksum
How to use checksums
f5a61fe9b1bc0dfa431b7e68119537324273a69212e0a70f4d9954e0fcf036eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.4

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page