Skip to main content

Mistro RPC Protocol Library

Project description

MistroRPC

Mistro is an RPC protocol & library made by Project VsingerXiaoice Group.

Usage

Example Server:

from mistrorpc import MistroServer
from fastapi import FastAPI
import uvicorn

app = FastAPI()
rpc = MistroServer(app, "password123456")

@rpc.rpc_fn("hello_world")
def hello_world(ping: str):
    return {"hello": "world", "ping": ping}

uvicorn.run(app, host="0.0.0.0", port=4431)

Example Client:

from mistrorpc import MistroClient
import asyncio

client = MistroClient(api="http://127.0.0.1", "password123456")

print("Sync Response:", client.get_fn("hello_world")("sync_response"))

async def main():
    print("Async Response:", await client.get_asyncfn("hello_world")("async_response"))

asyncio.run(main())

Protocol

API

See connect.py.

Pickle format

We use rePickle for encoding arguments & return values.

rePickle is an internal modules mistrorpc.pickle at pickle.py.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mistrorpc-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mistrorpc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mistrorpc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mistrorpc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe914f2e34ac53d99d68798d272a60019a72a1318da105671db87466a67ea35b
MD5 5a54af9108d6e4e71201d85b12af8c7c
BLAKE2b-256 487b038f77b05f51d4e4b47c3236d9ea982d33a82df75cdc811ab4870a98caba

See more details on using hashes here.

Supported by

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