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.12.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mause_rpc-0.0.12.tar.gz
  • Upload date:
  • Size: 4.0 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.12.tar.gz
Algorithm Hash digest
SHA256 5ae75dc93628de29e3a25fbdeceea99de5910b77681fa79767b0268fb2a69e1a
MD5 6269cfeb195d455ec2f6bb42537931ac
BLAKE2b-256 e72eab91ca36cfe520ccd399b71bb6efeca5dc03db64ea5d8e05e994cf9ce71c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mause_rpc-0.0.12-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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 b00b79c9b6c1b8db0be9b724e6647a99eeddaa41c66a003832f21f10a28cd6ca
MD5 c9e370cdd7f17ca9e8746233900c919f
BLAKE2b-256 7cfc70b4a5c071b8afc346d82279c1ca20873c7ef39bdd4edfeec884f2c4abd9

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