An asyncio compatible RPC framework for building distributed applications.
RMY provides a high level API allowing to expose objects from one process to the other. It frees programmers from having to handle communication between processes while still providing enough control when needed. The simplest possible use of RMY framework looks as follows.
import rmy
class Demo:
async def greet(self, name):
return f"Hello {name}!"
if __name__ == "__main__":
rmy.run_tcp_server(8080, Demo())
This will expose an instance of the Demo object which can then be remotely accessed to as follows.
import rmy
from hello_rmy_server import Demo
if __name__ == "__main__":
with rmy.create_sync_client("localhost", 8080) as client:
demo_remote = client.fetch_remote_object(Demo)
while True:
print('Enter your name:')
name = input()
print(demo_remote.greet.eval(name))
One can easily also asynchronously iterate through results generated by another object remotely. MY provides robust ways to iterate over (asynchronous) iterators applying back pressure if required. This allows to implement trivially Pub-Sub or any other event notification pattern easily. A trivial example of remote generator iteration might look like this.
import random
class Demo:
...
async def count(self):
for i in range(1_000_000):
await asyncio.sleep(random.uniform())
yield i
One can remotely iterate through the values using a normal loop.
for i in demo_remote.count():
print(i)
For smplicity sake we showcased examples in synchronous code. One can easily make those asynchronous by instanciating an asynchronous client.
Metadata
Release files for rmy 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rmy-0.1.5.tar.gz | 15.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rmy-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / rmy-0.1.5.tar.gz
| Download URL | rmy-0.1.5.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0173d53a016dc8dcf3ddb2db18d1039544b34902a05ee1e9c132ea581c8462bb
|
|
BLAKE2b-256 checksum How to use checksums |
e6b04feb7582b25aac04a81a6de1eaa4d15c4167295479c52d77e338667b7453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.4.0
|
Release files / rmy-0.1.5-py3-none-any.whl
| Download URL | rmy-0.1.5-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8faca6aefa566475210802e0bbb156f2e425c096956bde232dc4ef7352a73448
|
|
BLAKE2b-256 checksum How to use checksums |
a212c569c967a8fe1af4efe58358baade4a61e64e7ec9a5b0ee3e920ea045fce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.4.0
|
Security for rmy 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.