Skip to main content

A dumb as hell rpc implementation built on rabbitmq

Project description

Mause RPC

A dumb as hell rpc implementation built on rabbitmq

Need to write a server?

from mause_rpc.server import Server

rpc_queue = 'rpc.queue'
server = Server(rpc_queue, 'rabbitmq://...')


@server.register
def hello(name: str) -> str:
    return 'hello ' + name


@server.register
def div(a: int, b: int) -> float:
    if b == 0:
        raise ZeroDivisionError()
    return a / b


if __name__ == '__main__':
    server.serve()

Need a client?

from mause_rpc.client import get_client

rpc_queue = 'rpc.queue'
client = get_client(rpc_queue, 'rabbitmq://...')


def test_basic_functionality():
    assert client.hello('mark') == 'hello mark'
    assert client.div(5, 2) == 2.5

    with pytest.raises(ZeroDivisionError):
        client.div(5, 0)

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

mause_rpc-0.0.11.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

mause_rpc-0.0.11-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file mause_rpc-0.0.11.tar.gz.

File metadata

  • Download URL: mause_rpc-0.0.11.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.0 Windows/10

File hashes

Hashes for mause_rpc-0.0.11.tar.gz
Algorithm Hash digest
SHA256 739d727f143c7998194f2a3ac9d5d4d2908d00e2a2c45c0225d70885ddda2d9a
MD5 a39421e2ba7f2f122f04e4a01064430d
BLAKE2b-256 c4f1a6dc2e5f3fb476db5c4a58980e29c873560d5d45c9100f65d6e93d928015

See more details on using hashes here.

File details

Details for the file mause_rpc-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: mause_rpc-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.0 Windows/10

File hashes

Hashes for mause_rpc-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 32cde36e522e5d128eca24fb5a2f5538ebfc245e331d31177a2f1c6ed28134cc
MD5 3d105095551e963f0621aa681fb80393
BLAKE2b-256 e2b8b9389bd77e1dfef1baf989c0948e14c387a400760687037ec5b17975dcbd

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