rpyc-async
rpyc-async is an asyncio-native fork of RPyC (Remote Python Call), a transparent library for symmetrical remote procedure calls, clustering, and distributed-computing. RPyC makes use of object-proxying, a technique that employs python’s dynamic nature, to overcome the physical boundaries between processes and computers, so that remote objects can be manipulated as if they were local.
This fork adds native async/await support: async services, async clients, and bidirectional async callbacks driven by a persistent event loop.
Relationship to upstream RPyC
Upstream project |
RPyC by Tomer Filiba and contributors |
Forked at |
RPyC 6.0.1 |
This fork |
rpyc-async 1.0.0 (versioned independently) |
Distribution name |
rpyc-async |
Import name |
rpyc_async (see note below) |
Licence |
MIT (both upstream and this fork) |
The upstream commit history is preserved in this repository, so authorship and provenance of the original RPyC code remain visible in git log. See LICENSE and CONTRIBUTORS for attribution.
Installation
pip install rpyc-async
Requires Python 3.10+. The fork’s import name is rpyc_async, while upstream RPyC still uses rpyc — the two distributions can be installed side by side in the same environment. If you only need the classic synchronous API, install upstream RPyC (pip install rpyc); if you need the asyncio-native API, install this fork (pip install rpyc-async).
Existing code written for upstream can keep the shorter rpyc. spelling by aliasing the import at the top of each module:
import rpyc_async as rpyc
All examples in this README use that alias.
Platform Support
Server Selection Guide
rpyc-async provides two main server implementations. Choose based on your async requirements:
Server Type |
Use When |
Limitations |
|---|---|---|
ThreadedServer |
|
|
AsyncioServer |
|
|
Quick Examples
ThreadedServer (for simple sync/unidirectional async):
from rpyc_async import ThreadedServer, Service
class MyService(Service):
def exposed_sync_method(self, x):
return x * 2
server = ThreadedServer(MyService, port=18861)
server.start()
AsyncioServer (for bidirectional async with callbacks):
from rpyc_async import AsyncioServer, Service
import asyncio
class MyService(Service):
async def exposed_async_with_callback(self, callback, value):
# Server can call client's async callback
result = await callback(value * 2)
return f"Got: {result}"
async def main():
server = AsyncioServer(MyService, port=18861)
await server.start()
# Server runs in background, handle other tasks
await asyncio.sleep(3600) # or other async work
asyncio.run(main())
Client for AsyncioServer — use await rpyc.async_connect(...), NOT rpyc.connect():
import rpyc_async as rpyc
import asyncio
async def main():
conn = await rpyc.async_connect("localhost", 18861)
try:
# Native async method — just await.
result = await conn.root.some_async_method(42)
# Sync remote method? Wrap with rpyc.async_() to stay event-driven.
# Keep the wrapper in a variable: it is cached behind a weak ref.
a_sync = rpyc.async_(conn.root.some_sync_method)
sync_result = await a_sync(42)
finally:
await conn.aclose() # not conn.close() — that blocks the loop
asyncio.run(main())
rpyc.connect() is synchronous — it blocks socket.connect and every later sync_request on the calling thread. From inside an asyncio event loop it now raises RuntimeError pointing at rpyc.async_connect. See docs/DESIGN_ASYNC_CONNECT_POLICY.md.
For more details on async support, see docs/LIMITATIONS.md.
A screenshot of a remote client connecting to a server.
Note that text written to the server’s stdout is actually printed on the server’s console.
Documentation
Migration Guide — moving to the asyncio-native API
Documentation for classic synchronous RPyC lives at https://rpyc.readthedocs.io
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 rpyc_async-1.0.0.tar.gz.
File metadata
- Download URL: rpyc_async-1.0.0.tar.gz
- Upload date:
- Size: 123.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ad2fe44b3c48f183f306906ef956c724147c0810219cdd83bd11b984d2cb60b
|
|
| MD5 |
e3229e629b1fc7bd7e4b86053dda4739
|
|
| BLAKE2b-256 |
327cba62b9da3790966de7aa81e098db7d397ea5a62bbc79ac864c0b7949f878
|
Provenance
The following attestation bundles were made for rpyc_async-1.0.0.tar.gz:
Publisher:
publish.yml on rr-develop/rpyc_async
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpyc_async-1.0.0.tar.gz -
Subject digest:
6ad2fe44b3c48f183f306906ef956c724147c0810219cdd83bd11b984d2cb60b - Sigstore transparency entry: 2336146363
- Sigstore integration time:
-
Permalink:
rr-develop/rpyc_async@51277d139453d575b406f6c1397d19c6bdcda61b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/rr-develop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51277d139453d575b406f6c1397d19c6bdcda61b -
Trigger Event:
push
-
Statement type:
File details
Details for the file rpyc_async-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rpyc_async-1.0.0-py3-none-any.whl
- Upload date:
- Size: 139.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dc3a8af0c9b927cdf62832a7eda860d55c1f6aecf3c0e88facaa9d0eec64b96
|
|
| MD5 |
2deaf5625d9a4fa12625d1fa2839dea9
|
|
| BLAKE2b-256 |
7a5369c79c463b6b219f4d697893daf92ea98f1897eab0b5f0b88e717d7501c0
|
Provenance
The following attestation bundles were made for rpyc_async-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on rr-develop/rpyc_async
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpyc_async-1.0.0-py3-none-any.whl -
Subject digest:
1dc3a8af0c9b927cdf62832a7eda860d55c1f6aecf3c0e88facaa9d0eec64b96 - Sigstore transparency entry: 2336146379
- Sigstore integration time:
-
Permalink:
rr-develop/rpyc_async@51277d139453d575b406f6c1397d19c6bdcda61b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/rr-develop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51277d139453d575b406f6c1397d19c6bdcda61b -
Trigger Event:
push
-
Statement type: