Skip to main content

RPC for QuLab

Project description

Qulab_RPC

View build status Coverage Status Updates Python 3 PyPI version

RPC for Qulab

Installation

We encourage installing QuLab-RPC via the pip tool (a python package manager):

python -m pip install QuLab-RPC

To install from the latest source, you need to clone the GitHub repository on your machine.

git clone https://github.com/feihoo87/QuLab_RPC.git

Then dependencies and QuLab can be installed in this way:

cd QuLab_RPC
python -m pip install -r requirements.txt
python -m pip install -e .

Usage

Server

import asyncio
import math
from qurpc import ZMQServer


def start(loop):
    module = math
    server = ZMQServer(port=8765, loop=loop)
    server.set_module(module)
    server.start()

if __name__ == "__main__":
    import asyncio

    loop = asyncio.get_event_loop()

    start(loop)

    try:
        loop.run_forever()
    finally:
        loop.close()

Client

from qurpc import ZMQClient

addr = "tcp://127.0.0.1:8765"
client = ZMQClient(addr)

y = await client.sin(3.14)

Running Tests

To run tests:

python -m pytest

Reporting Issues

Please report all issues on github.

License

MIT

Project details


Download files

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

Files for QuLab-RPC, version 2.2.6
Filename, size File type Python version Upload date Hashes
Filename, size QuLab_RPC-2.2.6.tar.gz (26.4 kB) File type Source Python version None Upload date Hashes View
Filename, size QuLab_RPC-2.2.6-py3-none-any.whl (29.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page