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.2.tar.gz (134.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.2-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynenc_rustvello-0.1.2.tar.gz
  • Upload date:
  • Size: 134.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.2.tar.gz
Algorithm Hash digest
SHA256 9b1685cb3c253b495b9d05f1be3ad9fd9d4c4f6b5483aef51ecbeebf0f385196
MD5 0c59e282a760d15f61c0714680380a95
BLAKE2b-256 a66a81bed62273fd309165e898d4628256f6765da512d6a11571954343bd15c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynenc_rustvello-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c521303561d3807867f8f369cf732dc6e73ba4fe5fe916e6aff7b3d4286f8b3c
MD5 8894c4ac9bba12b088f3a71b5118ef92
BLAKE2b-256 fd36444981b8cd75bc5d53cc6e2b09cacda08fa1e21d6ad8d670d1613caf4971

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