Redis plugging for pynenc, a distributed task queue for Python.
Project description
Pynenc Redis Plugin
Full-stack Redis backend for Pynenc distributed task orchestration
Documentation: https://pynenc-redis.readthedocs.io
Pynenc Documentation: https://docs.pynenc.org
Source Code: https://github.com/pynenc/pynenc-redis
The pynenc-redis plugin provides all five Pynenc backend components running on Redis, enabling production-ready distributed task orchestration with a single infrastructure dependency.
Components
| Component | Class | Role |
|---|---|---|
| Orchestrator | RedisOrchestrator |
Distributed status tracking & blocking control |
| Broker | RedisBroker |
FIFO message queue via Redis lists with blocking pop |
| State Backend | RedisStateBackend |
Persistent state, results, exceptions & workflow data |
| Client Data Store | RedisClientDataStore |
Argument caching for large serialized payloads |
| Trigger | RedisTrigger |
Event-driven & cron-based task scheduling |
Installation
pip install pynenc-redis
The plugin registers itself automatically via Python entry points when installed.
Quick Start
from pynenc import PynencBuilder
app = (
PynencBuilder()
.app_id("my_app")
.redis(url="redis://localhost:6379") # all components on Redis
.process_runner()
.build()
)
@app.task
def add(x: int, y: int) -> int:
return x + y
result = add(1, 2).result # 3
.redis() registers every component at once. Start a runner with:
pynenc --app=tasks.app runner start
Configuration
Builder Parameters
# URL-based (recommended)
app = (
PynencBuilder()
.app_id("my_app")
.redis(url="redis://localhost:6379/0")
.multi_thread_runner(min_threads=2, max_threads=8)
.build()
)
# Database number only (uses host/port from env or defaults)
app = (
PynencBuilder()
.app_id("my_app")
.redis(db=1)
.process_runner()
.build()
)
Component-Specific Configuration
app = (
PynencBuilder()
.app_id("my_app")
.redis(url="redis://localhost:6379")
.redis_client_data_store(
min_size_to_cache=1024, # cache arguments > 1KB
local_cache_size=1000, # local LRU cache entries
)
.redis_trigger(
scheduler_interval_seconds=60,
enable_scheduler=True,
)
.build()
)
Environment Variables
PYNENC__REDIS__REDIS_URL="redis://localhost:6379/0"
# Or individual parameters:
PYNENC__REDIS__REDIS_HOST="localhost"
PYNENC__REDIS__REDIS_PORT=6379
PYNENC__REDIS__REDIS_DB=0
Connection URLs
.redis(url="redis://localhost:6379/0") # Standard
.redis(url="redis://:password@localhost:6379/0") # With password
.redis(url="rediss://localhost:6380/0") # SSL/TLS
Requirements
- Python >= 3.11
- Pynenc >= 0.1.0
- redis >= 4.6.0
- A running Redis server
Related Plugins
- pynenc-mongodb: Full-stack MongoDB backend
- pynenc-rabbitmq: RabbitMQ broker (pairs with Redis for state/orchestrator/triggers)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynenc_redis-0.1.5.tar.gz.
File metadata
- Download URL: pynenc_redis-0.1.5.tar.gz
- Upload date:
- Size: 435.7 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b9b376b0b892886201cad944c3b3d076763203f1a28229b28286089c6bcd30
|
|
| MD5 |
0d0dca5c7bb11b33f0c27573c2399455
|
|
| BLAKE2b-256 |
efe305867a985b1c2b6918ae4778205dadab1a53b6fe24104f687c83fd99568a
|
File details
Details for the file pynenc_redis-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pynenc_redis-0.1.5-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9772b95a004c52d10226bd91d132e89c267bfad583cec928531b1a2ff767f8
|
|
| MD5 |
ba6266c6071aefcc5c20623c9c58dbfe
|
|
| BLAKE2b-256 |
17347fab7e9b53e43f2c63dc4c6b16bef5bd6918a15651c5718480992ba7cbe3
|