Skip to main content

Cluster plugin for evoid — connect multiple nodes into a unified system

Project description

PyPI Python License

evoid-cluster

Multi-node clustering — Intent Handler system

Quick StartIntent HandlerArchitectureAPI


Quick Start

pip install evoid-cluster

Method 1: Intent Handler (Recommended)

from evoid_cluster import register_handlers

# Register cluster as Intent handlers
register_handlers(config={
    "node": {"id": "node-1", "host": "0.0.0.0", "port": 9100},
    "cluster": {"secret": "my-secret"},
})

Method 2: Direct API

from evoid_cluster import ClusterBridge, ClusterConfig

config = ClusterConfig.from_toml("cluster.toml")
bridge = ClusterBridge(config)

Intent Handler

evoid-cluster registers inter-node communication as Intent handlers.


Architecture

Node A (users)  ←──WebSocket──→  Node B (chat)
       ↕                              ↕
Node C (database) ←──WebSocket──→  Node D (game)

Each node:

  1. Announces its services via Intent through the message bus
  2. ClusterBridge forwards intents to remote nodes
  3. Only Intent and Result flow between nodes — never raw data

Configuration

TOML (separate file)

[node]
id = "node-1"
host = "0.0.0.0"
port = 9100

[cluster]
secret = "my-cluster-secret"

[cluster.peers]
"node-b" = { host = "192.168.1.11", port = 9100 }

API

register_handlers(config: dict)

Register cluster as Intent handlers.

ClusterBridge Methods

Method Signature Description
start async start() Start cluster node
stop async stop() Stop cluster node
broadcast async broadcast(intent) Send intent to all peers

Dependencies

  • evoid>=0.4.0
  • websockets>=12.0

Links

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.

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.

evoid_cluster-0.1.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file evoid_cluster-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: evoid_cluster-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for evoid_cluster-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a37a58048c382a0a383f2033c8be413cd593984306173e3f578a8db44822930
MD5 91c2ee30dba7ed3ad9581e3b3d17335a
BLAKE2b-256 3d34584c6f60abdd6d454003ffcd704961a0faa5623c0b9c32e2aa8280bd1b06

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