Metadata-Version: 2.1
Name: mause-rpc
Version: 0.0.8
Summary: A dumb as hell rpc implementation built on rabbitmq
Home-page: https://github.com/Mause/rpc
License: MIT
Keywords: rabbitmq,rpc
Author: Elliana May
Author-email: me@mause.me
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: dill (>=0.3.1,<0.4.0)
Requires-Dist: pika (>=1.1.0,<2.0.0)
Requires-Dist: retry (>=0.9.2,<0.10.0)
Project-URL: Repository, https://github.com/Mause/rpc
Description-Content-Type: text/markdown

Mause RPC
=========

A dumb as hell rpc implementation built on rabbitmq

Need to write a server?

```py
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):
    if b == 0:
        raise ZeroDivisionError()
    return a / b


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

```

Need a client?

```py
from mause_rpc.client import get_client

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

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

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

