This package mainly provides a solution for developers to implement RPC functionality using RabbitMQ.
Project description
PyRabbitmqRpc
This package mainly provides a solution for developers to implement RPC functionality using RabbitMQ.
demo https://github.com/liu-xiaokai/PyRabbitmqRpc/tree/main/demo
this is a simple example
client.py
from PyRabbitmqRpc.client import RpcClient
import inspect
from demo.conf import Conf
class MyClient(RpcClient):
def __init__(self, conf):
RpcClient.__init__(self, conf)
def get_sum(self, a=1, b=2, c=3):
frame = inspect.currentframe()
function_name = frame.f_code.co_name
response = self.call(func_name=function_name, a=a, b=b, c=c)
return response
if __name__ == '__main__':
api_rpc = MyClient(Conf)
print(api_rpc.get_sum())
manager.py
from PyRabbitmqRpc.manager import ManagerServer
from demo.conf import Conf
class Manager(object):
def get_sum(self, a=1, b=2, c=3):
return a + b + c
manager_server = ManagerServer(manager=Manager, conf=Conf)
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
PyRabbitmqRpc-1.2.1.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyRabbitmqRpc-1.2.1.tar.gz.
File metadata
- Download URL: PyRabbitmqRpc-1.2.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f40b7955e225b7d7ef45f7cf8b8b6a6f0b31ef56fc69c221995f24d3dd91fb46
|
|
| MD5 |
727dfaf2406dfb5ba3e0c7cc64ffb7f3
|
|
| BLAKE2b-256 |
e3a1eb30ef6a4373a5135b174d56bc6996c1c523be369dacf3f72147135ab40d
|
File details
Details for the file PyRabbitmqRpc-1.2.1-py3-none-any.whl.
File metadata
- Download URL: PyRabbitmqRpc-1.2.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08682fd9199f760f061e190c0e4d8f0d904dd2b0312ec96f5c6a7e6489dbca89
|
|
| MD5 |
25d5c2c9d7198fe4378607e17bd90384
|
|
| BLAKE2b-256 |
ee0d7f32cfb00155c94ed91cae3fbc332f1ae3178b64622f8617bced7fc74e76
|