Skip to main content

Rust-powered backend plugin for pynenc (via rustvello).

Project description

pynenc-rustvello

CI Lint Python 3.12+ License: MIT

Rust-powered backend plugin for pynenc distributed task orchestration — via the rustvello engine.

pynenc-rustvello provides high-performance Rust implementations of all pynenc storage interfaces (broker, orchestrator, state backend, trigger store, and client data store) across 6 storage backends, with optional native Rust orchestration for maximum throughput.

pynenc tasks remain Python code executed by pynenc's own runners (ThreadRunner, ProcessRunner, etc.). This plugin replaces only the storage layer — giving you Rust-level performance for state management, message queuing, and orchestration coordination without changing how your tasks run.

For full Rust task execution, use rustvello directly.

Components

Component Backends Role
Broker Mem, SQLite, Redis, Postgres, Mongo, RabbitMQ Task queue / message delivery
Orchestrator Mem, SQLite, Redis, Postgres, Mongo (native + delegated) Status tracking, blocking, recovery
State Backend Mem, SQLite, Redis, Postgres, Mongo Invocation state, results, exceptions
Client Data Store Mem, SQLite, Redis, Postgres, Mongo Argument caching for large payloads
Trigger Mem, SQLite, Redis, Postgres, Mongo Event-driven & cron-based scheduling

Installation

pip install pynenc-rustvello

Requires Python ≥ 3.12, pynenc ≥ 0.1.0, and rustvello ≥ 0.1.0.

Quick Start

pynenc-rustvello registers itself as a pynenc plugin via entry points. Once installed, Rust backends are available through pynenc's builder:

from pynenc import PynencBuilder

# In-memory Rust backend (fastest for testing)
app = PynencBuilder().app_id("my_app").rustvello_mem().build()

# SQLite Rust backend (persistent, zero-config)
app = PynencBuilder().app_id("my_app").rustvello_sqlite().build()

# Redis Rust backend (production)
app = (
    PynencBuilder()
    .app_id("my_app")
    .rustvello_redis(redis_url="redis://localhost:6379")
    .build()
)

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

result = add(1, 2).result  # 3

Mixing Backends

Combine different storage backends per component:

app = (
    PynencBuilder()
    .app_id("my_app")
    .rustvello_redis_broker(redis_url="redis://localhost:6379")
    .rustvello_postgres_state(postgres_url="postgresql://localhost/mydb")
    .rustvello_postgres_orchestrator(postgres_url="postgresql://localhost/mydb")
    .rustvello_redis_trigger(redis_url="redis://localhost:6379")
    .rustvello_redis_cds(redis_url="redis://localhost:6379")
    .build()
)

Architecture

pynenc-rustvello is a storage plugin — it replaces pynenc's storage layer with Rust-backed implementations while keeping task execution in Python.

┌────────────────────────────────────────────────┐
│                   pynenc app                   │
│                                                │
│  Tasks (Python)  ←→  Runner (Python)           │
│       │                    │                   │
│       ▼                    ▼                   │
│  ┌─────────────────────────────────────────┐   │
│  │     pynenc-rustvello (storage layer)    │   │
│  │  Broker · Orchestrator · State Backend  │   │
│  │  Trigger · Client Data Store            │   │
│  │         (all backed by Rust FFI)        │   │
│  └─────────────────────────────────────────┘   │
└────────────────────────────────────────────────┘

For users who want full Rust task execution (not just storage), use rustvello directly.

Documentation

Full documentation: pynenc-rustvello.readthedocs.io

Ecosystem

Package Description
pynenc Core distributed task framework
rustvello Rust engine powering this plugin
pynenc-redis Pure-Python Redis backend
pynenc-mongo Pure-Python MongoDB backend
pynenc-rabbitmq Pure-Python RabbitMQ broker

Development

# Clone the repository
git clone https://github.com/pynenc/pynenc_rustvello.git
cd pynenc_rustvello

# Install in dev mode
uv sync --all-extras

# Run tests
uv run python -m pytest tests/unit/ -q

# Lint
uv run ruff check pynenc_rustvello/ tests/
uv run ruff format --check pynenc_rustvello/ tests/

License

MIT

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

pynenc_rustvello-0.1.3.tar.gz (387.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynenc_rustvello-0.1.3-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file pynenc_rustvello-0.1.3.tar.gz.

File metadata

  • Download URL: pynenc_rustvello-0.1.3.tar.gz
  • Upload date:
  • Size: 387.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for pynenc_rustvello-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d20027848da8ea4ab41fa31579fd4dc0201356e1f4df684e42b36392b0e3b35f
MD5 64c0a87940dd9a9ab4d75bbe061118be
BLAKE2b-256 240903de223d59a4c97b9e680aa8ee9802f2b91b3f57d466d4ee57e64211b723

See more details on using hashes here.

File details

Details for the file pynenc_rustvello-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pynenc_rustvello-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for pynenc_rustvello-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c81469b8e433bc23f49c79e6cac6b48d88a6753176d138416bc441a9ed3b9e78
MD5 ed5184e3f258cbd1c109d41cbe7e3dbc
BLAKE2b-256 cc8b0dfc74d1a052f898c9141125eb3cedcad45b909fe021e2efa1e91965418e

See more details on using hashes here.

Supported by

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