Skip to main content

simple rpc based on zerorpc and gevent

Project description

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_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vxinaay_xnrpc-1.2.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

vxinaay_xnrpc-1.2.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file vxinaay_xnrpc-1.2.2.tar.gz.

File metadata

  • Download URL: vxinaay_xnrpc-1.2.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for vxinaay_xnrpc-1.2.2.tar.gz
Algorithm Hash digest
SHA256 1a9c6694ca07a951645ed202bf24012df47d4392f38d852490585195d5fc5839
MD5 24e9657b76ce2cf6665b7a74aa6304e8
BLAKE2b-256 4cdbde2bc2e80e342f8852d8e2dc09f6a4bb87b540e37d9b649ce7b814ead130

See more details on using hashes here.

File details

Details for the file vxinaay_xnrpc-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: vxinaay_xnrpc-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for vxinaay_xnrpc-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af74968d1fcf9e070348bd10e1638cdbf4673ab0f19d13a6e5a8ecb5dbf70a9d
MD5 c4aae1679f845e62c4590e8f560c4743
BLAKE2b-256 e6cfe10a0f758287a213051e379b43dc88e99ab147d4853ab1266fb0174df9c1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page