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.10.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file mause_rpc-0.0.10.tar.gz
.
File metadata
- Download URL: mause_rpc-0.0.10.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 | cbf685f66db6b092f250bf8c106baa3976bd659e51734585b671d77f4f9b1f53 |
|
MD5 | d42ae95818a99f61028db07bbc21ae34 |
|
BLAKE2b-256 | 4d47d700906eae5c8274bb597e687901ccb1389c5d6f6c4021e9d3c6874362a7 |
File details
Details for the file mause_rpc-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: mause_rpc-0.0.10-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 | c8bb260240115765c71ce91c5f50df47b7b2bc456a54166dab40fe3f2378fcfe |
|
MD5 | e3662c23cefa5133f43212cd4352ad47 |
|
BLAKE2b-256 | fbd78a6b0210d4579c4c298aea4f431c0ca717b109241eb34b9a192f0f30304a |