Skip to main content

Stateful rpc for Python

Project description

PyPI version Python Versions License: MIT test suite Coverage Status

How to use it

One can expose a Python object through a server as follow.

class Demo:
    async def greet(self, name):
        return f"Hello {name}!"


if __name__ == "__main__":
    rmy.run_tcp_server(8080, Demo())

This object can then be remotely access to as follows.

if __name__ == "__main__":
    with rmy.create_sync_client("localhost", 8080) as client:
        proxy: Demo = client.fetch_remote_object()
        print(proxy.greet("world"))

The object returned fetch_remote_object call is an ad hoc object which has the same interface as the one that has been exposed. One can also remotely access to the object attributes and even iterate asynchronously through data returned by the shared object.

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

rmy-0.1.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

rmy-0.1.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rmy-0.1.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for rmy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5a1e31975afda04ac6a6aab8bd591ae7ca81c782b6526b06ba11904808b779a2
MD5 0a534e4417b9e7185a05555f29dfecb6
BLAKE2b-256 f8a879c8317d7acb7bd8fd6fd82ef1e1bf540a84d3f11402d54c7adf5a66a060

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rmy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for rmy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 29fb6bfc9c356f77058b4bb4061bdaf31d8f9f6c50344854c0eef4b7143e76d6
MD5 7d2a76acb6d48a6421514737166b45cd
BLAKE2b-256 af229c505b558b9c196639f71d2480f1a6080dba31e79d54c456a7fe833ec391

See more details on using hashes here.

Supported by

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