Skip to main content

Peer-to-peer remote object proxies over multiplexed streams

Project description

Proxyables (Python)

A high-performance, peer-to-peer RPC library that makes remote objects feel local. Built on top of Yamux multiplexing and Python's __getattr__ magic, it enables seamless bi-directional interaction between processes with support for callbacks, distributed garbage collection, and transparent async proxying.

Features

  • Peer-to-Peer Architecture: No strict client/server distinction — both sides can import and export objects, enabling true bi-directional communication.
  • "Local-Feeling" API: Intercepts property access, method calls, and item access using __getattr__ and __getitem__, making remote objects behave like local ones.
  • Distributed Garbage Collection: Automatically manages remote object lifecycles using weakref and a reference counting protocol.
  • Bi-Directional Callbacks: Pass functions and objects as arguments — they are automatically registered and hydrated as proxies on the other side.
  • Instruction Batching: Chains of property accesses and method calls are accumulated and sent as a single EXECUTE instruction for efficiency.
  • Stream Multiplexing: Uses Yamux to multiplex concurrent operations over a single connection.

Installation

pip install stateforward.proxyables

Usage

Basic Example

Server (Exporting an object):

from proxyables import Proxyable

class API:
    def echo(self, msg: str) -> str:
        return f"echo {msg}"

    def compute(self, a: int, b: int) -> int:
        return a + b

# stream is any asyncio duplex stream
exported = await Proxyable.Export(API(), stream)

Client (Importing the object):

from proxyables import Proxyable

proxy = await Proxyable.ImportFrom(stream)

# Usage - feels completely local!
result = await proxy.echo("hello")    # "echo hello"
result = await proxy.compute(10, 20)  # 30

Architecture

  1. Proxy Layer: ProxyCursor wraps remote objects, accumulating instructions on property access and method calls.
  2. Instruction Protocol: Operations (get, apply, etc.) are serialized into ProxyInstruction messages using MessagePack.
  3. Transport: Uses Yamux to multiplex concurrent operations over a single connection (TCP, Unix socket, stdio, etc.).
  4. Reference Management: An ObjectRegistry tracks local objects passed by reference with automatic cleanup via weakref.

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

stateforward_proxyables-0.1.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

stateforward_proxyables-0.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file stateforward_proxyables-0.1.0.tar.gz.

File metadata

  • Download URL: stateforward_proxyables-0.1.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stateforward_proxyables-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4bb61c520826acd1bf5fde67287bc3372b810863ad4e64e991b36a94ba23daaa
MD5 2cf1ada97be482541be092e1dc474e26
BLAKE2b-256 0c5c7e93f30920b140d477fdf2551ab73c960cfcba7d3ca727ff3f2e8036f41a

See more details on using hashes here.

File details

Details for the file stateforward_proxyables-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stateforward_proxyables-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stateforward_proxyables-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b24f79c262779097f5e5da2e2a092749998c1f4157ad7974130fa8812e4eb683
MD5 4af6eeaa7f725350acd135d2db029aca
BLAKE2b-256 497c867335790ac88fbaef4b450dc450b48c6749708a25861fc1c07c812a7de7

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