xnrpc
xnrpc is a light-weight, reliable and language-agnostic library for distributed communication between server-side processes. It builds on top of zerorpc and gevent, simple ,efficient and robust.
features
support heartbeat and timeout
graceful exceptions handler
support pipeline commands
asynchronous I/O, support large concurrency
very simple to use
demo
a simple server and client example:
from xnrpc.server import RpcInterface, ServerManager
from xnrpc.client import open_client
from xnrpc.common.log import get_log
_log = get_log(__name__)
class OperationRpcInterface(RpcInterface):
def ls_file(self):
_log.info('Operation ls file')
return None
def check_ip(self):
_log.info('Operation check ip')
return None
if __name__ == '__main__':
# 启动RPC服务器
rpc_interface = OperationRpcInterface
url = 'tcp://127.0.0.1:7772'
server = ServerManager(url, rpc_interface, name='Test Server')
server.start()
# 建立一个客户端连接
with open_client(url) as client:
client.ls_file()
client.check_ip()
# 停止服务器
server.stop()
Resources
Metadata
Release files for xnrpc 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xnrpc-1.2.2.tar.gz | 9.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xnrpc-1.2.2-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 21.6 kB
Release files / xnrpc-1.2.2.tar.gz
| Download URL | xnrpc-1.2.2.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95750f72b4877ba7c7afacca1439ef4c75727ac3c24081cf4aa3de7fe530a869
|
|
BLAKE2b-256 checksum How to use checksums |
ff45ff5bcf7eb21697f4ba6f5c6a0c3ab9de58a19d7a976cacdfd394727dcb21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / xnrpc-1.2.2-py2-none-any.whl
| Download URL | xnrpc-1.2.2-py2-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
ea539ffd7e1d9a7ec1ee754297b614a683db1e8c426e56950e75efd6a012c1f8
|
|
BLAKE2b-256 checksum How to use checksums |
f7d9b75199d8c8de6895a896caf76bacb6bcfc0e09b5d71871e8b0aa5de4f787
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for xnrpc 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.