Skip to main content

Scalable Remote Function Calling Framework

Project description

harmoney DOI

Distributed Function Caller Framework for Python

Installation:

pip install harmoney

Dependencies:

  • websockets
  • fastapi
  • requests
  • uvicorn
  • pydantic

Usage:

Requires 3 scripts: Client, Broker and Runner

  • Broker will mediate load balancing and connection handling, so this should start first. One port should be open.

Let broker's IP be 192.168.0.110 and port be 7732

from harmoney import router as rou

ro.startRouter("0.0.0.0", 7732)
  • Runner performs the calculations, should contain function definitions. Connects to broker using broker's IP.
from harmoney import runners as run

def customFunction(arg1: int, arg2: str) -> str:
    return arg2*arg1

funcs = {"custFn": customFunction}

run.startRunner(funcs, "192.168.0.110", 7732)
  • Client is the main caller of functions. Will contain your main code.
from harmoney import client as cli

cli.Client("192.168.0.110", 7732)

retVal = cli.runSingle("custFn", arg1=10, arg2="arst")

print(retVal)

TODO:

  • Error catching, keeping the connection to the broker
  • Error info should return to the client
  • Remove dependency on fastapi and requests, move to completely to websockets

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

harmoney-0.3.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

harmoney-0.3.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file harmoney-0.3.0.tar.gz.

File metadata

  • Download URL: harmoney-0.3.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for harmoney-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0ee3f7a5f3dba537cde5be5bef09eb29b31f7adab8db007d5641b4ba069443bd
MD5 121cb257e29d0d364c0c130466fcc4a2
BLAKE2b-256 2c473b4569270114697346f83af9cf1d83e805759f16332e5faaa18575048c99

See more details on using hashes here.

File details

Details for the file harmoney-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: harmoney-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for harmoney-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73e4e933e0c16921a5cb722f0479eca9462ba6a54d8fd872fa7d2dd978850e71
MD5 d98f4925e3987da84eaade1a5f30d8ec
BLAKE2b-256 684660ab07a7be1f4ccc8ead1ed82373f4b296cbfddcb3fba769346dc98d08be

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