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.13.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file mause_rpc-0.0.13.tar.gz
.
File metadata
- Download URL: mause_rpc-0.0.13.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b08cb057fae40545e074ebebf72efe9157db329c3b22d33b2a51c5468db20188 |
|
MD5 | c1b7b2e1c873009d734d859bc54752a9 |
|
BLAKE2b-256 | bd03b14344c601671a2a869f02d5a17ef3b733eb707b465914edc5a75b24cf40 |
File details
Details for the file mause_rpc-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: mause_rpc-0.0.13-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cbeec92b06f059c1c2a9827c2b516cfd0f9c2e75c3e7d1e1514d73062b25b06 |
|
MD5 | 3cc2d1ce35113badb2079dee2713cee2 |
|
BLAKE2b-256 | 2cfb24d86052506be9961c3c16acc5ca29ad0a3d64646c650904d8e646e50273 |