Skip to main content

remrpc

REdis Msgpack RPC

Installation

pip install remrpc

Example

import redis
import remrpc

def add(a, b):
    return a + b

def sub(a, b):
    return a - b

def multi():
    return "Hello", "World"

def kvfunc(k="key", v="val"):
    return "{0} = {1}".format(k, v)

def nonreturn():
    print("Non Return")

class CallObject:
    def __call__(self, name):
        return "Hello {0}".format(name)

if __name__ == "__main__":
    pool = redis.ConnectionPool(host="127.0.0.1",
                                port=6379,
                                password="123456")
    rpc1 = remrpc.RPC(redis.Redis(connection_pool=pool), "channel:rpc1")
    rpc2 = remrpc.RPC(redis.Redis(connection_pool=pool), "channel:rpc2")

    rpc1.register(add)
    rpc1.register(sub)
    rpc1.register(multi)
    rpc1.register(kvfunc)
    rpc1.register(CallObject(), 'sayhello')
    rpc1.register(nonreturn)

    try:
        invoker = rpc2.invoker("channel:rpc1")

        print(invoker.add(1, 2))
        print(invoker.sub(9, 5))
        print(invoker.multi())
        print(invoker.kvfunc(k="KEY", v="VALUE"))
        print(invoker.sayhello("World"))
        print(invoker.nonreturn())
        print(invoker.nonexistent())
    except remrpc.TimedoutRPC as e:
        print("> RPC Timedout: {0}".format(e))
    except remrpc.CallErrorRPC as e:
        print("> RPC Call Error: {0}".format(e))
    except remrpc.ExceptionRPC as e:
        print("> RPC Exception: {0}".format(e))

    rpc1.close()
    rpc2.close()

Metadata

Release files for remrpc 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for remrpc 0.1.11
File Size Uploaded Provenance Actions
remrpc-0.1.11.tar.gz 4.4 kB Without provenance Details for remrpc-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for remrpc 0.1.11
File Interpreter ABI Platform Actions
remrpc-0.1.11-py3-none-any.whl Python 3 none any Details for remrpc-0.1.11-py3-none-any.whl

Total release size: 13.1 kB

Release files / remrpc-0.1.11.tar.gz

Download URL remrpc-0.1.11.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f5bfe2af1702090ef34ce8a517eea3f9876ff7ba50f5a8f65e101d453f8b671e
BLAKE2b-256 checksum
How to use checksums
cefcc476b4ddc674fcb5b36195bdd12ffc208be85bc1f8477047ba54f442813f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

Release files / remrpc-0.1.11-py3-none-any.whl

Download URL remrpc-0.1.11-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cfcde76379f3098c0c14713ee0b7a528b6a9f7a5abe78316b348814b318f303
BLAKE2b-256 checksum
How to use checksums
009afa766f3d93ef60bb568e2c566c417d751d00dd8635ec0cc3d6001141a3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

Security for remrpc 0.1.11

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page