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.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for evoid_cluster-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15a0c6539add9e3a48c1853946922e61b340e12c132bb087da30df3271d11bf2
MD5 21a1e966e686c027be3690e46c79d91d
BLAKE2b-256 1dd672b3f5813a8dd3da256d722067174ae3aa4a9f339967d019fd162e220fc2

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