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
Release history Release notifications | RSS feed
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.9.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file mause_rpc-0.0.9.tar.gz
.
File metadata
- Download URL: mause_rpc-0.0.9.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca5a039e10bc34a1644e7b1032a07f5f4ebf0aa932e1d8f2c6d0255e4920084e |
|
MD5 | 459c13f72eac2b3591a92ab83ea93a20 |
|
BLAKE2b-256 | 9440d63642b977cce10d1bcb58f59fa493b63b439207ec9e5894031f7f3ab77d |
File details
Details for the file mause_rpc-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: mause_rpc-0.0.9-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3706b55f431dd613bd65c6a3b5d273d4fb3aa828cb9ba3528d497c6fd02666c |
|
MD5 | 73e9e253348a87f6bd68d785172fc340 |
|
BLAKE2b-256 | 4ff88e8e4fa554079a62b322620b8212555fc3c878680fddb58dcce7a1bdc5f6 |